Package org.gbif.api.model.registry
Class Identifier
- java.lang.Object
-
- org.gbif.api.model.registry.Identifier
-
- All Implemented Interfaces:
Serializable,LenientEquals<Identifier>
public class Identifier extends Object implements Serializable, LenientEquals<Identifier>
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Identifier()Identifier(IdentifierType type, String identifier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)@Null(groups=PrePersist.class) @NotNull(groups=PostPersist.class) DategetCreated()@Size(min=3) StringgetCreatedBy()@NotNull @Size(min=1) StringgetIdentifier()StringgetIdentifierLink()Creates a http link for an identifier if possible by passing it to some known resolvers for the specific id type.@Null(groups=PrePersist.class) @NotNull(groups=PostPersist.class) @Min(1L) IntegergetKey()@NotNull IdentifierTypegetType()inthashCode()booleanisPrimary()booleanlenientEquals(Identifier other)A lenient equality check ignoring server controlled values (createdBy, key etc).voidsetCreated(Date created)voidsetCreatedBy(String createdBy)voidsetIdentifier(String identifier)voidsetKey(Integer key)voidsetPrimary(boolean primary)voidsetType(IdentifierType type)StringtoString()
-
-
-
Constructor Detail
-
Identifier
public Identifier()
-
Identifier
public Identifier(IdentifierType type, String identifier)
-
-
Method Detail
-
getKey
@Null(groups=PrePersist.class) @NotNull(groups=PostPersist.class) @Min(1L) public @Null(groups=PrePersist.class) @NotNull(groups=PostPersist.class) @Min(1L) Integer getKey()
-
getType
@NotNull public @NotNull IdentifierType getType()
-
setType
public void setType(IdentifierType type)
-
getIdentifier
@NotNull @Size(min=1) public @NotNull @Size(min=1) String getIdentifier()
-
setIdentifier
public void setIdentifier(String identifier)
-
getCreatedBy
@Size(min=3) public @Size(min=3) String getCreatedBy()
-
setCreatedBy
public void setCreatedBy(String createdBy)
-
getCreated
@Null(groups=PrePersist.class) @NotNull(groups=PostPersist.class) public @Null(groups=PrePersist.class) @NotNull(groups=PostPersist.class) Date getCreated()
-
setCreated
public void setCreated(Date created)
-
isPrimary
public boolean isPrimary()
-
setPrimary
public void setPrimary(boolean primary)
-
getIdentifierLink
@Nullable public String getIdentifierLink()
Creates a http link for an identifier if possible by passing it to some known resolvers for the specific id type. If no link can be constructed, null is returned.- Returns:
- the url or null if it cannot be created
- See Also:
IdentifierUtils.getIdentifierLink(String, org.gbif.api.vocabulary.IdentifierType)
-
lenientEquals
public boolean lenientEquals(Identifier other)
A lenient equality check ignoring server controlled values (createdBy, key etc).- Specified by:
lenientEqualsin interfaceLenientEquals<Identifier>- Parameters:
other- To compare against- Returns:
- true if...
-
-