public class RegexProperty extends BaseProperty<Pattern>
| Constructor and Description |
|---|
RegexProperty(@NotNull String path,
@NotNull Pattern defaultValue)
Constructor.
|
RegexProperty(@NotNull String path,
@NotNull String defaultRegexValue)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected @Nullable Pattern |
getFromReader(@NotNull PropertyReader reader,
@NotNull ConvertErrorRecorder errorRecorder)
Constructs the value of the property from the property reader.
|
boolean |
matches(@NotNull String value,
@NotNull SettingsManager settingsManager)
Convenience method to evaluate whether the pattern set for this property matches the provided
value. |
@NotNull Object |
toExportValue(@NotNull Pattern value)
Converts the given value to a representation that is suitable for exporting by a property resource.
|
determineValue, getDefaultValue, getPath, isValidValue, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisValidInResourcepublic RegexProperty(@NotNull
@NotNull String path,
@NotNull
@NotNull Pattern defaultValue)
path - the path of the propertydefaultValue - the default value of the property@Nullable protected @Nullable Pattern getFromReader(@NotNull @NotNull PropertyReader reader, @NotNull @NotNull ConvertErrorRecorder errorRecorder)
BasePropertygetFromReader in class BaseProperty<Pattern>reader - the reader to read fromerrorRecorder - error recorder to register errors even if a valid value is returned@NotNull public @NotNull Object toExportValue(@NotNull @NotNull Pattern value)
Property
The values which are suitable for returning depend on the support of the used property resource. By default,
the supported types include null, String, Integer, Double, Boolean; Collection of the aforementioned
types; Map with String keys and values of any of the aforementioned types. Maps and collections can be nested at
any arbitrary level. Null signifies that the property/value should be skipped in the export.
value - the value to convert to an export valuepublic boolean matches(@NotNull
@NotNull String value,
@NotNull
@NotNull SettingsManager settingsManager)
value.value - the value to check whether it conforms to the configured patternsettingsManager - settings manager with which the configured pattern is retrievedCopyright © 2016–2023 The AuthMe Team. All rights reserved.