Class MetadataPolicy.Builder

java.lang.Object
net.shibboleth.oidc.metadata.policy.MetadataPolicy.Builder
Enclosing class:
MetadataPolicy

public static class MetadataPolicy.Builder extends Object
Builder class for the MetadataPolicy objects.
  • Field Details

    • forcedValue

      private Object forcedValue
      The (forced) value for the claim.
    • add

      private Object add
      The value(s) to be added for the claim.
    • defaultValue

      private Object defaultValue
      The default value for the claim to be used in case none is specified.
    • oneOfValues

      private List<Object> oneOfValues
      The list of values from which the claim must be one of.
    • subsetOfValues

      private List<Object> subsetOfValues
      The list of value(s) from which the claim must be subset of.
    • supersetOfValues

      private List<Object> supersetOfValues
      The list of value(s) from which the claim must be superset of.
    • essential

      private Boolean essential
      The flag indicating that the claim must have a value.
    • regexp

      private String regexp
      The regular expression that the claim value must meet.
    • customOperators

      private final Map<String,Object> customOperators
      The map of any other operators not directly mapped.
  • Constructor Details

    • Builder

      public Builder()
      Constructor.
  • Method Details

    • withValue

      public MetadataPolicy.Builder withValue(Object value)
      Set the (forced) value for the claim.
      Parameters:
      value - What to set.
      Returns:
      The builder object with the new value set.
    • withAdd

      public MetadataPolicy.Builder withAdd(Object value)
      Set the value(s) to be added for the claim.
      Parameters:
      value - What to set.
      Returns:
      The builder object with the new value set.
    • withDefaultValue

      public MetadataPolicy.Builder withDefaultValue(Object value)
      Set the default value for the claim to be used in case none is specified.
      Parameters:
      value - What to set.
      Returns:
      The builder object with the new value set.
    • withOneOfValues

      public MetadataPolicy.Builder withOneOfValues(List<Object> values)
      Set the list of values from which the claim must be one of.
      Parameters:
      values - What to set.
      Returns:
      The builder object with the new value set.
    • withSubsetOfValues

      public MetadataPolicy.Builder withSubsetOfValues(List<Object> values)
      Set the list of value(s) from which the claim must be subset of.
      Parameters:
      values - What to set.
      Returns:
      The builder object with the new value set.
    • withSupersetOfValues

      public MetadataPolicy.Builder withSupersetOfValues(List<Object> values)
      Set the list of value(s) from which the claim must be superset of.
      Parameters:
      values - What to set.
      Returns:
      The builder object with the new value set.
    • withEssential

      public MetadataPolicy.Builder withEssential(Boolean isEssential)
      Set the flag indicating that the claim must have a value.
      Parameters:
      isEssential - What to set.
      Returns:
      The builder object with the new value set.
    • withRegexp

      public MetadataPolicy.Builder withRegexp(String value)
      Set the regular expression that the claim value must meet.
      Parameters:
      value - What to set.
      Returns:
      The builder object with the new value set.
    • withCustomOperator

      public MetadataPolicy.Builder withCustomOperator(String name, Object value)
      Add a custom operator to the map of custom operators.
      Parameters:
      name - The name of the custom operator.
      value - The value of the custom operator.
      Returns:
      The builder object with the new value set.
      Since:
      3.1.0
    • build

      public MetadataPolicy build()
      Build the metadata policy corresponding to the current builder state.
      Returns:
      The metadata policy corresponding to the current builder state.