Package com.google.common.jimfs
Enum Class PathNormalization
- All Implemented Interfaces:
com.google.common.base.Function<String,
,String> Serializable
,Comparable<PathNormalization>
,Constable
,Function<String,
String>
public enum PathNormalization
extends Enum<PathNormalization>
implements com.google.common.base.Function<String,String>
Normalizations that can be applied to names in paths. Includes Unicode normalizations and
normalizations for case insensitive paths. These normalizations can be set in
Configuration.Builder
when creating a Jimfs file system instance and are automatically applied
to paths in the file system.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract String
Applies this normalization to the given string, returning the normalized result.static Pattern
compilePattern
(String regex, Iterable<PathNormalization> normalizations) Compiles a regex pattern using flags based on the given normalizations.static String
normalize
(String string, Iterable<PathNormalization> normalizations) Applies the given normalizations to the given string in order, returning the normalized result.int
Returns the flags that should be used when creating a regexPattern
in order to approximate this normalization.static PathNormalization
Returns the enum constant of this class with the specified name.static PathNormalization[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from interface com.google.common.base.Function
equals
-
Enum Constant Details
-
Field Details
-
patternFlags
private final int patternFlags
-
-
Constructor Details
-
PathNormalization
private PathNormalization(int patternFlags)
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
apply
Applies this normalization to the given string, returning the normalized result. -
patternFlags
public int patternFlags()Returns the flags that should be used when creating a regexPattern
in order to approximate this normalization. -
normalize
Applies the given normalizations to the given string in order, returning the normalized result. -
compilePattern
Compiles a regex pattern using flags based on the given normalizations.
-