Skip to content

Commit 118e815

Browse files
committed
Add implementation for ConstraintDescriptor#getAttribute
Signed-off-by: marko-bekhta <[email protected]>
1 parent 3b4ddaa commit 118e815

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

engine/src/main/java/org/hibernate/validator/internal/metadata/descriptor/ConstraintDescriptorImpl.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,12 @@ public Map<String, Object> getAttributes() {
296296
return annotationDescriptor.getAttributes();
297297
}
298298

299+
@Override
300+
public <V> V getAttribute(String name, Class<V> type) {
301+
Object value = annotationDescriptor.getAttributes().get( name );
302+
return value == null ? null : type.cast( value );
303+
}
304+
299305
@SuppressWarnings("unchecked")
300306
@Override
301307
public Set<ConstraintDescriptor<?>> getComposingConstraints() {

0 commit comments

Comments
 (0)