Class Aliased

java.lang.Object
org.litebridgedb.db.spi.Aliased
Direct Known Subclasses:
Column, Table

public class Aliased extends Object
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 Details

    • Aliased

      public Aliased(String name)
    • Aliased

      public Aliased(String name, @Nullable String alias)
  • Method Details

    • name

      public String name()
      Retrieve the name of the aliased entity.
      Returns:
      the name of the aliased entity
    • alias

      public @Nullable String alias()
      Retrieve the alias of the aliased entity.
      Returns:
      the alias of the aliased entity, or null if no alias is set
    • aliasOrName

      public String 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

      public Aliased as(String alias)
      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 Aliased with the specified alias set
    • setAlias

      public final void setAlias(String alias)
      Set the alias for this entity.
      Parameters:
      alias - the alias to assign to this entity; must not be null
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • equalsIgnoreAlias

      public boolean equalsIgnoreAlias(Aliased aliased)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object