mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-22 15:10:02 +00:00
Refactor ScalarType move format() default method from ScalarTypeBase to ScalarType
This commit is contained in:
1 parent
7d1772cb54
commit
186019da7f
9 files changed
+4
-45
No files matched your search
@@ -88,12 +88,6 @@ abstract class ScalarTypeBaseVarchar<T> extends ScalarTypeBase<T> {
|
||||
return format(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public String format(Object value) {
|
||||
return formatValue((T) value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public T readData(DataInput dataInput) throws IOException {
|
||||
if (!dataInput.readBoolean()) {
|
||||
|
||||
@@ -74,11 +74,6 @@ public final class ScalarTypeBytesEncrypted implements ScalarType<byte[]> {
|
||||
return baseType.docType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String format(Object v) {
|
||||
throw new RuntimeException("Not used");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String formatValue(byte[] v) {
|
||||
throw new RuntimeException("Not used");
|
||||
|
||||
@@ -99,12 +99,6 @@ public final class ScalarTypeEncryptedWrapper<T> implements ScalarType<T>, Local
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public String format(Object v) {
|
||||
return formatValue((T) v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String formatValue(T v) {
|
||||
return wrapped.formatValue(v);
|
||||
|
||||
@@ -63,11 +63,6 @@ class ScalarTypeNotFound implements ScalarType<Void> {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String format(Object value) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Void parse(String value) {
|
||||
throw new UnsupportedOperationException();
|
||||
|
||||
@@ -104,12 +104,6 @@ public class ScalarTypeWrapper<B, S> implements ScalarType<B> {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public String format(Object v) {
|
||||
return formatValue((B) v);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String formatValue(B v) {
|
||||
S sv = converter.unwrapValue(v);
|
||||
|
||||
Reference in new issue
Block a user