@HashCodeAndEqualsPlugin.Enhance public static class HashCodeAndEqualsPlugin.WithNonNullableFields extends HashCodeAndEqualsPlugin
HashCodeAndEqualsPlugin
that assumes that all fields are non-nullable unless they are explicitly marked.HashCodeAndEqualsPlugin.AnnotationOrderComparator, HashCodeAndEqualsPlugin.Enhance, HashCodeAndEqualsPlugin.Sorted, HashCodeAndEqualsPlugin.ValueHandling, HashCodeAndEqualsPlugin.ValueMatcher, HashCodeAndEqualsPlugin.WithNonNullableFields
Plugin.Engine, Plugin.Factory, Plugin.ForElementMatcher, Plugin.NoOp, Plugin.WithInitialization, Plugin.WithPreprocessor
ElementMatcher.Junction<S>
Plugin.Factory.Simple, Plugin.Factory.UsingReflection
MethodAttributeAppender.Factory.Compound
MethodAttributeAppender.Compound, MethodAttributeAppender.Explicit, MethodAttributeAppender.Factory, MethodAttributeAppender.ForInstrumentedMethod, MethodAttributeAppender.ForReceiverType, MethodAttributeAppender.NoOp
Constructor and Description |
---|
WithNonNullableFields()
Creates a new hash code equals plugin where fields are assumed nullable by default.
|
WithNonNullableFields(String annotationType)
Creates a new hash code equals plugin where fields are assumed nullable by default.
|
Modifier and Type | Method and Description |
---|---|
protected ElementMatcher<FieldDescription> |
nonNullable(ElementMatcher<FieldDescription> matcher)
Resolves the matcher to identify non-nullable fields.
|
public WithNonNullableFields()
public WithNonNullableFields(@MaybeNull String annotationType)
annotationType
- Defines the binary name of a runtime-visible annotation type that should be added to the
parameter of the Object.equals(Object)
method, or null
if no such name
should be defined.protected ElementMatcher<FieldDescription> nonNullable(ElementMatcher<FieldDescription> matcher)
nonNullable
in class HashCodeAndEqualsPlugin
matcher
- The matcher that identifies fields that are either nullable or non-nullable.Copyright © 2014–2024. All rights reserved.