Class UserRestriction

All Implemented Interfaces:
Serializable, Comparable

public class UserRestriction extends GeneratedUserRestriction
This restriction restricts vouchers to specified users.
See Also:
  • Constructor Details

    • UserRestriction

      public UserRestriction()
  • Method Details

    • getMessageAttributeValues

      protected String[] getMessageAttributeValues()
      Description copied from class: Restriction
      Returns the values for making violation messages more useful.
      Overrides:
      getMessageAttributeValues in class Restriction
    • getUsers

      public Collection getUsers(SessionContext ctx)
      Returns a collection of principals which contains users or usergroups
      Overrides:
      getUsers in class GeneratedUserRestriction
      Parameters:
      ctx - the SessionContext
      Returns:
      Collection of principals
    • isFulfilledInternal

      protected boolean isFulfilledInternal(AbstractOrder anOrder)
      Returns true if the specified abstract order fulfills this restriction. More formally, returns true if the principal (user or an user from an usergroup) of the specified abstract order is contained in the set of principals defined by this restriction.
      Specified by:
      isFulfilledInternal in class Restriction
      Parameters:
      anOrder - the abstract order to check whether it fullfills this restriction.
      Returns:
      true if the specified abstract order fulfills this restriction, false else.
      See Also:
    • isPartOfConfiguredPrincipals

      protected boolean isPartOfConfiguredPrincipals(User user)
      returns true if the given user is part of this restriction's defined users, otherwise false.
    • isFulfilledInternal

      protected boolean isFulfilledInternal(Product aProduct)
      Returns true if the specified product fulfills this restriction.
      Specified by:
      isFulfilledInternal in class Restriction
      Parameters:
      aProduct - the product to check whether it fullfills this restriction.
      Returns:
      true if the specified product fulfills this restriction, false else.
      See Also: