org.hibernate.validator.internal.metadata.aggregated

## Class AbstractConstraintMetaData

- java.lang.Object
- - org.hibernate.validator.internal.metadata.aggregated.AbstractConstraintMetaData

- All Implemented Interfaces:
    Iterable<MetaConstraint<?>>, ConstraintMetaData
  Direct Known Subclasses:
    ExecutableMetaData, ParameterMetaData, PropertyMetaData, ReturnValueMetaData

      public abstract class AbstractConstraintMetaData
      extends Object
      implements ConstraintMetaData

  Base implementation for `ConstraintMetaData` with attributes common to all type of meta data.
  Author:
    Gunnar Morling

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractConstraintMetaData(String name, Type type, Set<MetaConstraint<?>> constraints, ElementKind constrainedMetaDataKind, boolean isCascading, boolean isConstrained, boolean requiresUnwrapping)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Set<ConstraintDescriptorImpl<?>>` | `asDescriptors(Set<MetaConstraint<?>> constraints)`
    `boolean` | `equals(Object obj)`
    `Set<MetaConstraint<?>>` | `getConstraints()`
    `ElementKind` | `getKind()` Returns the `kind` of this meta data object.
    `String` | `getName()` Returns the name of this meta data object.
    `Type` | `getType()` Returns the data type of this meta data object, e.g.
    `int` | `hashCode()`
    `boolean` | `isCascading()` Whether this meta data object is marked for cascaded validation or not.
    `boolean` | `isConstrained()` Whether this meta data object is constrained by any means or not.
    `Iterator<MetaConstraint<?>>` | `iterator()`
    `boolean` | `requiresUnwrapping()` Whether the value to be validated needs to be unwrapped (which is the case if this element is annotated with `@UnwrapValidatedValue`) or not.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.hibernate.validator.internal.metadata.aggregated.ConstraintMetaData

      `asDescriptor`

- - ### Constructor Detail

    - #### AbstractConstraintMetaData

          public AbstractConstraintMetaData(String name,
                                    Type type,
                                    Set<MetaConstraint<?>> constraints,
                                    ElementKind constrainedMetaDataKind,
                                    boolean isCascading,
                                    boolean isConstrained,
                                    boolean requiresUnwrapping)

  - ### Method Detail

    - #### getName

          public String getName()

      Description copied from interface: `ConstraintMetaData`
      Returns the name of this meta data object.
      Specified by:
        `getName` in interface `ConstraintMetaData`
      Returns:
        This meta data object's name.

    - #### getType

          public Type getType()

      Description copied from interface: `ConstraintMetaData`
      Returns the data type of this meta data object, e.g. the type of a bean property or the return type of a method.
      Specified by:
        `getType` in interface `ConstraintMetaData`
      Returns:
        This meta data object's type.

    - #### iterator

          public Iterator<MetaConstraint<?>> iterator()

      Specified by:
        `iterator` in interface `Iterable<MetaConstraint<?>>`

    - #### getConstraints

          public Set<MetaConstraint<?>> getConstraints()

    - #### getKind

          public ElementKind getKind()

      Description copied from interface: `ConstraintMetaData`
      Returns the `kind` of this meta data object.
      Specified by:
        `getKind` in interface `ConstraintMetaData`
      Returns:
        The `kind` of this meta data object.

    - #### isCascading

          public boolean isCascading()

      Description copied from interface: `ConstraintMetaData`
      Whether this meta data object is marked for cascaded validation or not.
      Specified by:
        `isCascading` in interface `ConstraintMetaData`
      Returns:
        `True` if this object is marked for cascaded validation, `false` otherwise.

    - #### isConstrained

          public boolean isConstrained()

      Description copied from interface: `ConstraintMetaData`
      Whether this meta data object is constrained by any means or not.
      Specified by:
        `isConstrained` in interface `ConstraintMetaData`
      Returns:
        `True` if this object is marked for cascaded validation or has any constraints, `false` otherwise.

    - #### requiresUnwrapping

          public boolean requiresUnwrapping()

      Description copied from interface: `ConstraintMetaData`
      Whether the value to be validated needs to be unwrapped (which is the case if this element is annotated with `@UnwrapValidatedValue`) or not.
      Specified by:
        `requiresUnwrapping` in interface `ConstraintMetaData`
      Returns:
        `true` if the value to be validated needs to unwrapped, `false` otherwise.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### asDescriptors

          protected Set<ConstraintDescriptorImpl<?>> asDescriptors(Set<MetaConstraint<?>> constraints)

Copyright © 2007-2014 Red Hat, Inc. All Rights Reserved