com.vladsch.boxed.json.BoxedJsValueLiteral Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of boxed-json Show documentation
Show all versions of boxed-json Show documentation
Mutable JSON classes with easy search and manipulation in Java
package com.vladsch.boxed.json;
import org.jetbrains.annotations.NotNull;
import javax.json.JsonValue;
public class BoxedJsValueLiteral implements BoxedJsValue {
final protected JsonValue myJsonValue;
final protected BoxedValueType myBoxedValueType;
BoxedJsValueLiteral(final JsonValue jsonValue) {
myJsonValue = jsonValue;
myBoxedValueType = BoxedValueType.getBoxedType(myJsonValue.getValueType());
}
BoxedJsValueLiteral(final boolean jsonValue) {
myJsonValue = jsonValue ? JsonValue.TRUE : JsonValue.FALSE;
myBoxedValueType = BoxedValueType.getBoxedType(myJsonValue.getValueType());
}
@NotNull
@Override
public BoxedValueType getBoxedValueType() {
return myBoxedValueType;
}
@NotNull @Override public JsonValue jsonValue() {
return myJsonValue;
}
public int hashCode() {
return myJsonValue.hashCode();
}
public String toString() {
return myJsonValue.toString();
}
public boolean equals(Object obj) {
return obj instanceof JsonValue && myJsonValue.equals(((JsonValue) obj));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy