public abstract class IntegerEntityId extends java.lang.Object implements EntityId, java.lang.Comparable<IntegerEntityId>, org.fuin.objects4j.vo.ValueObjectWithBaseType<java.lang.Integer>
| Modifier and Type | Class and Description |
|---|---|
static interface |
IntegerEntityId.IntegerEntityIdStr
Ensures that the integer can be converted into the type.
|
static class |
IntegerEntityId.Validator
Validates if a string is compliant with the type.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
MIN
Minimum valid value (inclusive).
|
| Constructor and Description |
|---|
IntegerEntityId(@NotNull EntityType entityType,
@NotNull java.lang.Integer id)
Constructor with Integer.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Integer |
asBaseType() |
java.lang.String |
asString()
Returns the entity identifier as string.
|
java.lang.String |
asTypedString()
Returns the entity identifier as string with type and identifier.
|
int |
compareTo(IntegerEntityId other) |
boolean |
equals(java.lang.Object obj) |
java.lang.Class<java.lang.Integer> |
getBaseType() |
EntityType |
getType()
Returns the type represented by this identifier.
|
int |
hashCode() |
static boolean |
isValid(java.lang.Integer value)
Verifies that a given string can be converted into the type.
|
static void |
requireArgValid(@NotNull java.lang.String name,
@NotNull java.lang.Integer value)
Verifies if the argument is valid and throws an exception if this is not the case.
|
java.lang.String |
toString() |
public static final int MIN
public IntegerEntityId(@NotNull
@NotNull EntityType entityType,
@NotNull
@NotNull java.lang.Integer id)
entityType - Entity type.id - Integer.public final int hashCode()
hashCode in class java.lang.Objectpublic final boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic final int compareTo(IntegerEntityId other)
compareTo in interface java.lang.Comparable<IntegerEntityId>public final java.lang.String toString()
toString in class java.lang.Objectpublic final java.lang.String asString()
EntityIdpublic final java.lang.String asTypedString()
EntityIdasTypedString in interface EntityIdpublic final EntityType getType()
EntityIdpublic final java.lang.Class<java.lang.Integer> getBaseType()
getBaseType in interface org.fuin.objects4j.vo.ValueObjectWithBaseType<java.lang.Integer>public final java.lang.Integer asBaseType()
asBaseType in interface org.fuin.objects4j.vo.ValueObjectWithBaseType<java.lang.Integer>public static boolean isValid(java.lang.Integer value)
value - Value to validate.true if it's a valid type else false.public static void requireArgValid(@NotNull
@NotNull java.lang.String name,
@NotNull
@NotNull java.lang.Integer 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.Copyright © 2019 fuin.org (Germany). All Rights Reserved.