Class Contrast

java.lang.Object
de.espirit.firstspirit.storage.Contrast

@NonExtendable public class Contrast extends Object
Container for contrast information, describing changes between elements
Since:
4.0.51
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Describes the type of difference between elements
  • Constructor Summary

    Constructors
    Constructor
    Description
    Contrast(@NotNull Contrast.Type type)
    Creates a new instance with the specified type and no additional information
    Contrast(@NotNull Contrast.Type type, @Nullable Object info)
    Creates a new instance with the specified type and optional additional information
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    @Nullable Object
    Get an info object associated with the change.
    @NotNull Contrast.Type
    Get the type of change.
    boolean
    Indicates this contrast to represent that the user had insufficient access rights for providing contrast information.
    int
     
    static @NotNull Contrast
    noAccess(@NotNull Contrast.Type type)
    Creates a new instance indicating that there were insufficient permissions to retrieve the contrast information

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Contrast

      public Contrast(@NotNull @NotNull Contrast.Type type)
      Creates a new instance with the specified type and no additional information
      Parameters:
      type - the type of the new contrast, must not be null
      Since:
      4.0.51
    • Contrast

      public Contrast(@NotNull @NotNull Contrast.Type type, @Nullable @Nullable Object info)
      Creates a new instance with the specified type and optional additional information
      Parameters:
      type - the type of the new contrast, must not be null
      info - the type of the new contrast, may be null
      Since:
      4.0.51
  • Method Details

    • noAccess

      @NotNull public static @NotNull Contrast noAccess(@NotNull @NotNull Contrast.Type type)
      Creates a new instance indicating that there were insufficient permissions to retrieve the contrast information
      Parameters:
      type - the type of the new contrast, must not be null
      Returns:
      the new contrast, never null
      Since:
      4.0.51
    • hadNoAccess

      public boolean hadNoAccess()
      Indicates this contrast to represent that the user had insufficient access rights for providing contrast information.
      Returns:
      true, if the requesting user had no access to some data to be contrasted on.
      Since:
      4.0.51
    • getType

      @NotNull public @NotNull Contrast.Type getType()
      Get the type of change.
      Returns:
      The change's type.
      Since:
      4.0.51
    • getInfo

      @Nullable public @Nullable Object getInfo()
      Get an info object associated with the change. The type of this object is specified by the Contrast.Type.
      Returns:
      The associated info object.
      Since:
      4.0.51
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object