java.lang.Object
org.salespointframework.useraccount.Role
All Implemented Interfaces:
Serializable, Comparable<Role>, org.jmolecules.ddd.types.ValueObject

@Embeddable public final class Role extends Object implements Serializable, Comparable<Role>, org.jmolecules.ddd.types.ValueObject
A Role is only identified by a name. This class is immutable.
Author:
Christopher Bellmann, Paul Henke
See Also:
  • Method Details

    • of

      public static Role of(String name)
      Creates a new Role instance with the given name.
      Parameters:
      name - the name of the Role, must not be null or empty.
      Returns:
      will never be null.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public final int compareTo(Role other)
      Specified by:
      compareTo in interface Comparable<Role>
    • getName

      @NonNull public @NonNull String getName()
      The name of the role.
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object