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 boolean
equals(Object o)
@Null(groups=PrePersist.class) @NotNull(groups=PostPersist.class) Date
getCreated()
@Size(min=3) String
getCreatedBy()
@NotNull @Size(min=1) String
getIdentifier()
String
getIdentifierLink()
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) Integer
getKey()
@NotNull IdentifierType
getType()
int
hashCode()
boolean
isPrimary()
boolean
lenientEquals(Identifier other)
A lenient equality check ignoring server controlled values (createdBy, key etc).void
setCreated(Date created)
void
setCreatedBy(String createdBy)
void
setIdentifier(String identifier)
void
setKey(Integer key)
void
setPrimary(boolean primary)
void
setType(IdentifierType type)
String
toString()
-
-
-
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:
lenientEquals
in interfaceLenientEquals<Identifier>
- Parameters:
other
- To compare against- Returns:
- true if...
-
-