@ThreadSafe public final class EntityIdConverter extends javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,EntityId> implements javax.json.bind.adapter.JsonbAdapter<EntityId,java.lang.String>
| Constructor and Description |
|---|
EntityIdConverter(EntityIdFactory factory)
Constructor with factory.
|
| Modifier and Type | Method and Description |
|---|---|
EntityId |
adaptFromJson(java.lang.String str) |
java.lang.String |
adaptToJson(EntityId obj) |
java.lang.String |
fromVO(EntityId value)
Converts the value object into a String.
|
boolean |
isValid(java.lang.String value)
Verifies that the given value can be converted into a value object using the factory.
|
java.lang.String |
marshal(EntityId value) |
void |
requireArgValid(@NotNull java.lang.String name,
@NotNull java.lang.String value)
Verifies if the argument is valid and throws an exception if this is not the case.
|
EntityId |
toVO(java.lang.String value)
Converts a string into an entity identifier.
|
EntityId |
unmarshal(java.lang.String value) |
public EntityIdConverter(EntityIdFactory factory)
factory - Factory to use.public final boolean isValid(java.lang.String value)
null parameter will return
true.value - Value to check.true if the value can be converted, else false.public final void requireArgValid(@NotNull
@NotNull java.lang.String name,
@NotNull
@NotNull java.lang.String value)
throws org.fuin.objects4j.common.ConstraintViolationException
name - Name of the value for a possible error message.value - Value to check.org.fuin.objects4j.common.ConstraintViolationException - The value was not valid.public final EntityId toVO(java.lang.String value)
null parameter will return null.value - Representation of the entity identifier as string.public final java.lang.String fromVO(EntityId value)
null parameter will return null.value - Value object.public final java.lang.String marshal(EntityId value) throws java.lang.Exception
marshal in class javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,EntityId>java.lang.Exceptionpublic final EntityId unmarshal(java.lang.String value) throws java.lang.Exception
unmarshal in class javax.xml.bind.annotation.adapters.XmlAdapter<java.lang.String,EntityId>java.lang.Exceptionpublic final java.lang.String adaptToJson(EntityId obj) throws java.lang.Exception
adaptToJson in interface javax.json.bind.adapter.JsonbAdapter<EntityId,java.lang.String>java.lang.ExceptionCopyright © 2019 fuin.org (Germany). All Rights Reserved.