Interface ILicenseContext

All Known Implementing Classes:
DefaultLicenseContext

public interface ILicenseContext
A container holding properties for creation and verification of licenses.
Author:
ralph
  • Method Summary

    Modifier and Type Method Description
    <T> T get​(java.lang.Class<T> clazz)
    Returns the property of given class.
    java.lang.Object get​(java.lang.String key)
    Returns the property with given key.
    java.lang.Iterable<java.lang.String> getKeys()
    Returns the property keys.
    boolean hasKey​(java.lang.Class<?> clazz)
    Returns whether the context has such a value.
    boolean hasKey​(java.lang.String key)
    Returns whether the context has such a value.
    <T> T remove​(java.lang.Class<T> clazz)
    Removes the property of given class.
    java.lang.Object remove​(java.lang.String key)
    Removes the property with given key.
    <T> void set​(java.lang.Class<T> clazz, T value)
    Sets the property.
    void set​(java.lang.String key, java.lang.Object value)
    Sets the property.
  • Method Details

    • get

      java.lang.Object get​(java.lang.String key)
      Returns the property with given key.
      Parameters:
      key - key of property
      Returns:
      the value or null if the property doesn't exist
    • get

      <T> T get​(java.lang.Class<T> clazz)
      Returns the property of given class. The class parameter will be the key of the property.
      Type Parameters:
      T - type of value
      Parameters:
      clazz - type of property
      Returns:
      the value or null if the property doesn't exist
    • hasKey

      boolean hasKey​(java.lang.Class<?> clazz)
      Returns whether the context has such a value.
      Parameters:
      clazz - the clazz to look for (name is key)
      Returns:
      true when context has this key
    • hasKey

      boolean hasKey​(java.lang.String key)
      Returns whether the context has such a value.
      Parameters:
      key - the key to look for
      Returns:
      true when context has this key
    • set

      void set​(java.lang.String key, java.lang.Object value)
      Sets the property.
      Parameters:
      key - key of property
      value - value
    • set

      <T> void set​(java.lang.Class<T> clazz, T value)
      Sets the property. The property key will be the name of the class parameter.
      Type Parameters:
      T - type of value
      Parameters:
      clazz - class of property
      value - value
    • remove

      java.lang.Object remove​(java.lang.String key)
      Removes the property with given key.
      Parameters:
      key - key of property
      Returns:
      the value that was removed
    • remove

      <T> T remove​(java.lang.Class<T> clazz)
      Removes the property of given class. The key of the removed property is the class parameter name.
      Type Parameters:
      T - type of value
      Parameters:
      clazz - class of property
      Returns:
      the value that was removed
    • getKeys

      java.lang.Iterable<java.lang.String> getKeys()
      Returns the property keys.
      Returns:
      an iterable of all property keys