Record Class DeprecatedProperty
java.lang.Object
java.lang.Record
com.patbaumgartner.spring.migrator.core.DeprecatedProperty
- Record Components:
key- the canonical name of the deprecated propertyreplacement- the canonical name of the property that replaces it, ornullwhen there is nonereason- the short reason recorded in the metadata, ornulllevel- the deprecation level, ornullwhen the metadata omits it
public record DeprecatedProperty(String key, String replacement, String reason, org.springframework.boot.configurationmetadata.Deprecation.Level level)
extends Record
A deprecated configuration property as described by Spring Boot configuration metadata.
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecatedProperty(String key, String replacement, String reason) Creates a deprecation whose level the metadata did not state.DeprecatedProperty(String key, String replacement, String reason, org.springframework.boot.configurationmetadata.Deprecation.Level level) Creates an instance of aDeprecatedPropertyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns whether the metadata names a property to migrate to.booleanReturns whether the property is already removed rather than merely discouraged.key()Returns the value of thekeyrecord component.org.springframework.boot.configurationmetadata.Deprecation.Levellevel()Returns the value of thelevelrecord component.reason()Returns the value of thereasonrecord component.Returns the value of thereplacementrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DeprecatedProperty
Creates a deprecation whose level the metadata did not state.- Parameters:
key- the canonical name of the deprecated propertyreplacement- the replacement property name, ornullreason- the short reason, ornull
-
DeprecatedProperty
public DeprecatedProperty(String key, String replacement, String reason, org.springframework.boot.configurationmetadata.Deprecation.Level level) Creates an instance of aDeprecatedPropertyrecord class.- Parameters:
key- the value for thekeyrecord componentreplacement- the value for thereplacementrecord componentreason- the value for thereasonrecord componentlevel- the value for thelevelrecord component
-
-
Method Details
-
hasReplacement
public boolean hasReplacement()Returns whether the metadata names a property to migrate to.- Returns:
- whether a replacement is available
-
isRemoved
public boolean isRemoved()Returns whether the property is already removed rather than merely discouraged.- Returns:
- whether the deprecation level is
error
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
key
Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
replacement
Returns the value of thereplacementrecord component.- Returns:
- the value of the
replacementrecord component
-
reason
Returns the value of thereasonrecord component.- Returns:
- the value of the
reasonrecord component
-
level
public org.springframework.boot.configurationmetadata.Deprecation.Level level()Returns the value of thelevelrecord component.- Returns:
- the value of the
levelrecord component
-