pick 97420a31d The big reformat of 2020

This commit is contained in:
yueh
2020-06-16 21:41:28 +02:00
parent 5304b3febe
commit 5225ea426b
2252 changed files with 95466 additions and 118582 deletions
+21 -23
View File
@@ -18,34 +18,32 @@
package appeng.util;
import java.util.regex.Pattern;
/**
* Regex wrapper for {@link java.util.UUID}s to not rely on try catch
*/
public final class UUIDMatcher
{
/**
* String which is the regular expression for {@link java.util.UUID}s
*/
private static final String UUID_REGEX = "[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}";
public final class UUIDMatcher {
/**
* String which is the regular expression for {@link java.util.UUID}s
*/
private static final String UUID_REGEX = "[0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}";
/**
* Pattern which pre-compiles the {@link appeng.util.UUIDMatcher#UUID_REGEX}
*/
private static final Pattern PATTERN = Pattern.compile( UUID_REGEX );
/**
* Pattern which pre-compiles the {@link appeng.util.UUIDMatcher#UUID_REGEX}
*/
private static final Pattern PATTERN = Pattern.compile(UUID_REGEX);
/**
* Checks if a potential {@link java.util.UUID} is an {@link java.util.UUID} by applying a regular expression on it.
*
* @param potential to be checked potential {@link java.util.UUID}
*
* @return true, if the potential {@link java.util.UUID} is indeed an {@link java.util.UUID}
*/
public boolean isUUID( final CharSequence potential )
{
return PATTERN.matcher( potential ).matches();
}
/**
* Checks if a potential {@link java.util.UUID} is an {@link java.util.UUID} by
* applying a regular expression on it.
*
* @param potential to be checked potential {@link java.util.UUID}
*
* @return true, if the potential {@link java.util.UUID} is indeed an
* {@link java.util.UUID}
*/
public boolean isUUID(final CharSequence potential) {
return PATTERN.matcher(potential).matches();
}
}