Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions src/main/java/org/mybatis/dynamic/sql/SqlColumn.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
* method and cast the result properly. We provide a {@link SqlColumn#cast(SqlColumn)} method to aid with this
* process. For example, overriding the {@code descending} method could look like this:
*
* <p>
* <pre>
* {@code
* @Override
Expand Down Expand Up @@ -237,8 +236,8 @@ public Optional<RenderingStrategy> renderingStrategy() {
* and method chaining would not work. This is a workaround for Java's lack of reification.
*
* @param typeHandler the type handler to set
* @return a new column instance with the specified type handler
* @param <S> the type of the new column (will be the same as T)
* @return a new column instance with the specified type handler
*/
public <S> SqlColumn<S> withTypeHandler(String typeHandler) {
return cast(copyBuilder().withTypeHandler(typeHandler).build());
Expand All @@ -253,8 +252,8 @@ public <S> SqlColumn<S> withTypeHandler(String typeHandler) {
* and method chaining would not work. This is a workaround for Java's lack of reification.
*
* @param renderingStrategy the rendering strategy to set
* @return a new column instance with the specified type handler
* @param <S> the type of the new column (will be the same as T)
* @return a new column instance with the specified type handler
*/
public <S> SqlColumn<S> withRenderingStrategy(RenderingStrategy renderingStrategy) {
return cast(copyBuilder().withRenderingStrategy(renderingStrategy).build());
Expand All @@ -271,8 +270,8 @@ public <S> SqlColumn<S> withRenderingStrategy(RenderingStrategy renderingStrateg
* and method chaining would not work. This is a workaround for Java's lack of reification.
*
* @param parameterTypeConverter the parameter type converter to set
* @return a new column instance with the specified type handler
* @param <S> the type of the new column (will be the same as T)
* @return a new column instance with the specified type handler
*/
@SuppressWarnings("unchecked")
public <S> SqlColumn<S> withParameterTypeConverter(ParameterTypeConverter<S, ?> parameterTypeConverter) {
Expand All @@ -292,8 +291,8 @@ public <S> SqlColumn<S> withParameterTypeConverter(ParameterTypeConverter<S, ?>
* and method chaining would not work. This is a workaround for Java's lack of reification.
*
* @param javaType the Java type to set
* @return a new column instance with the specified type handler
* @param <S> the type of the new column (will be the same as T)
* @return a new column instance with the specified type handler
*/
@SuppressWarnings("unchecked")
public <S> SqlColumn<S> withJavaType(Class<S> javaType) {
Expand All @@ -312,8 +311,8 @@ public <S> SqlColumn<S> withJavaType(Class<S> javaType) {
* and method chaining would not work. This is a workaround for Java's lack of reification.
*
* @param javaProperty the Java property to set
* @return a new column instance with the specified type handler
* @param <S> the type of the new column (will be the same as T)
* @return a new column instance with the specified type handler
*/
public <S> SqlColumn<S> withJavaProperty(String javaProperty) {
return cast(copyBuilder().withJavaProperty(javaProperty).build());
Expand Down Expand Up @@ -366,7 +365,7 @@ public static <T> SqlColumn<T> of(String name, SqlTable table, JDBCType jdbcType
.build();
}

public static abstract class AbstractBuilder<T, C extends SqlColumn<T>, B extends AbstractBuilder<T, C, B>> {
public abstract static class AbstractBuilder<T, C extends SqlColumn<T>, B extends AbstractBuilder<T, C, B>> {
protected @Nullable String name;
protected @Nullable SqlTable table;
protected @Nullable JDBCType jdbcType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ public class IsGreaterThanOrEqualToWhenPresent<T> extends AbstractSingleValueCon
implements AbstractSingleValueCondition.Filterable<T>, AbstractSingleValueCondition.Mappable<T> {
private static final IsGreaterThanOrEqualToWhenPresent<?> EMPTY =
new IsGreaterThanOrEqualToWhenPresent<Object>(-1) {
@Override
public Object value() {
throw new NoSuchElementException("No value present"); //$NON-NLS-1$
}
@Override
public Object value() {
throw new NoSuchElementException("No value present"); //$NON-NLS-1$
}

@Override
public boolean isEmpty() {
return true;
}
};
@Override
public boolean isEmpty() {
return true;
}
};

public static <T> IsGreaterThanOrEqualToWhenPresent<T> empty() {
@SuppressWarnings("unchecked")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ public class IsLikeCaseInsensitiveWhenPresent<T> extends AbstractSingleValueCond
AbstractSingleValueCondition.Mappable<T> {
private static final IsLikeCaseInsensitiveWhenPresent<?> EMPTY =
new IsLikeCaseInsensitiveWhenPresent<>("") { //$NON-NLS-1$
@Override
public String value() {
throw new NoSuchElementException("No value present"); //$NON-NLS-1$
}
@Override
public String value() {
throw new NoSuchElementException("No value present"); //$NON-NLS-1$
}

@Override
public boolean isEmpty() {
return true;
}
};
@Override
public boolean isEmpty() {
return true;
}
};

public static <T> IsLikeCaseInsensitiveWhenPresent<T> empty() {
@SuppressWarnings("unchecked")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ public class IsNotLikeCaseInsensitiveWhenPresent<T> extends AbstractSingleValueC
AbstractSingleValueCondition.Mappable<T> {
private static final IsNotLikeCaseInsensitiveWhenPresent<?> EMPTY =
new IsNotLikeCaseInsensitiveWhenPresent<>("") { //$NON-NLS-1$
@Override
public String value() {
throw new NoSuchElementException("No value present"); //$NON-NLS-1$
}
@Override
public String value() {
throw new NoSuchElementException("No value present"); //$NON-NLS-1$
}

@Override
public boolean isEmpty() {
return true;
}
};
@Override
public boolean isEmpty() {
return true;
}
};

public static <T> IsNotLikeCaseInsensitiveWhenPresent<T> empty() {
@SuppressWarnings("unchecked")
Expand Down