refactor: split field init attribute
This commit is contained in:
+22
-1
@@ -1,7 +1,9 @@
|
||||
package jadx.api.plugins.input.data.annotations;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class EncodedValue {
|
||||
public static final EncodedValue NULL = new EncodedValue(EncodedType.ENCODED_NULL, new Object());
|
||||
public static final EncodedValue NULL = new EncodedValue(EncodedType.ENCODED_NULL, null);
|
||||
|
||||
private final EncodedType type;
|
||||
private final Object value;
|
||||
@@ -19,9 +21,28 @@ public class EncodedValue {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
EncodedValue that = (EncodedValue) o;
|
||||
return type == that.getType() && Objects.equals(value, that.getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(getType(), getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
switch (type) {
|
||||
case ENCODED_NULL:
|
||||
return "null";
|
||||
case ENCODED_STRING:
|
||||
return (String) value;
|
||||
case ENCODED_ARRAY:
|
||||
|
||||
Reference in New Issue
Block a user