Class SubjectMapping

java.lang.Object
com.caplin.permissioning.SubjectMapping

public class SubjectMapping extends Object
A convenience class that can be used by implementations of SubjectMapper to store the keys and subject mappings passed to its updateMappings method.
  • Constructor Details

    • SubjectMapping

      public SubjectMapping(String key, Map<String,String> map)
      Creates a new SubjectMapping using the passed in key and map.
      Parameters:
      key - the key for this SubjectMapping.
      map - the subject mappings for this SubjectMapping
  • Method Details

    • getKey

      public String getKey()
      Gets the the key that was passed to the constructor.
      Returns:
      the key
    • getMap

      public Map<String,String> getMap()
      Gets the subject mappings that were passed to the constructor.
      Returns:
      the subject mappings
    • toString

      public String toString()
      Returns a string representation of this SubjectMapping.
      Overrides:
      toString in class Object
      Returns:
      a string describing this SubjectMapping, including its key and subject mappings.
    • hashCode

      public int hashCode()
      Returns a hash code value for this SubjectMapping. This method is consistent with this class' equals(java.lang.Object) method, as required by the general contract of the Object.hashCode() method.
      Overrides:
      hashCode in class Object
      Returns:
      the hashCode for this SubjectMapping
      See Also:
    • equals

      public boolean equals(Object obj)
      Compares the passed in object to this SubjectMapping. Returns true if the objects are equal and false otherwise.
      Overrides:
      equals in class Object
      Parameters:
      obj - the object to compare to this SubjectMapping.
      Returns:
      true if obj is a SubjectMapping with the same key and subject mappings as this SubjectMapping. Otherwise returns false.