java.lang.Object
org.litebridge.db.spi.Aliased
A name and an optional alias.
This class provides functionality to create and manage aliased entities. It is designed to be extended by other classes that require naming and optional aliasing.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable Stringalias()Retrieve the alias of the aliased entity.Retrieve the alias if it is set; otherwise, return the name.Set the alias for this entity and return the updated instance.booleanbooleanequalsIgnoreAlias(Aliased aliased) Compares this instance with anotherAliasedinstance, ignoring their aliases.inthashCode()name()Retrieve the name of the aliased entity.final voidSet the alias for this entity.
-
Constructor Details
-
Aliased
Constructs a newAliasedinstance with the specified name.- Parameters:
name- The target name.
-
Aliased
Constructs a newAliasedinstance with the specified name and alias.- Parameters:
name- The target name.alias- The target alias.
-
-
Method Details
-
name
Retrieve the name of the aliased entity.- Returns:
- the name of the aliased entity
-
alias
Retrieve the alias of the aliased entity.- Returns:
- the alias of the aliased entity, or
nullif no alias is set
-
aliasOrName
Retrieve the alias if it is set; otherwise, return the name.- Returns:
- the alias of the entity if it exists, or the name if no alias is set
-
as
Set the alias for this entity and return the updated instance.- Parameters:
alias- the alias to assign to this entity; must not be null- Returns:
- the updated instance of
Aliasedwith the specified alias set
-
setAlias
Set the alias for this entity.- Parameters:
alias- the alias to assign to this entity; must not be null
-
equals
-
equalsIgnoreAlias
Compares this instance with anotherAliasedinstance, ignoring their aliases.- Parameters:
aliased- The other instance to compare with.- Returns:
trueif the names are equal,falseotherwise.
-
hashCode
public int hashCode()
-