Skip to content

Commit

Permalink
Deprecate all CharMatcher constants.
Browse files Browse the repository at this point in the history
Removal date tentative based on date of 20.0 release.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117833310
  • Loading branch information
cgdecker committed Mar 22, 2016
1 parent 72f1743 commit 94f1bf0
Showing 1 changed file with 61 additions and 3 deletions.
64 changes: 61 additions & 3 deletions guava/src/com/google/common/base/CharMatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ public static CharMatcher singleWidth() {
}

// Legacy constants
// TODO(cgdecker): Deprecate these so they can be removed eventually

/**
* Determines whether a character is whitespace according to the latest Unicode
Expand All @@ -222,7 +221,11 @@ public static CharMatcher singleWidth() {
*
* <p><b>Note:</b> as the Unicode definition evolves, we will modify this constant
* to keep it up to date.
*
* @deprecated Use {@link #whitespace()} instead. This constant is scheduled to be
* removed in June 2018.
*/
@Deprecated
public static final CharMatcher WHITESPACE = whitespace();

/**
Expand All @@ -231,67 +234,106 @@ public static CharMatcher singleWidth() {
* {@link #whitespace} for a discussion of that term.
*
* @since 2.0
* @deprecated Use {@link #breakingWhitespace()} instead. This constant is scheduled
* to be removed in June 2018.
*/
@Deprecated
public static final CharMatcher BREAKING_WHITESPACE = breakingWhitespace();

/**
* Determines whether a character is ASCII, meaning that its code point is less than
* 128.
*
* @deprecated Use {@link #ascii()} instead. This constant is scheduled to be
* removed in June 2018.
*/
@Deprecated
public static final CharMatcher ASCII = ascii();

/**
* Determines whether a character is a digit according to
* <a href="http://unicode.org/cldr/utility/list-unicodeset.jsp?a=%5Cp%7Bdigit%7D">
* Unicode</a>. If you only care to match ASCII digits, you can use
* {@code inRange('0', '9')}.
*
* @deprecated Use {@link #digit()} instead. This constant is scheduled to be
* removed in June 2018.
*/
@Deprecated
public static final CharMatcher DIGIT = digit();

/**
* Determines whether a character is a digit according to
* {@linkplain Character#isDigit(char) Java's definition}. If you only care to match
* ASCII digits, you can use {@code inRange('0', '9')}.
*
* @deprecated Use {@link #javaDigit()} instead. This constant is scheduled to be
* removed in June 2018.
*/
@Deprecated
public static final CharMatcher JAVA_DIGIT = javaDigit();

/**
* Determines whether a character is a letter according to
* {@linkplain Character#isLetter(char) Java's definition}. If you only care to
* match letters of the Latin alphabet, you can use
* {@code inRange('a', 'z').or(inRange('A', 'Z'))}.
*
* @deprecated Use {@link #javaLetter()} instead. This constant is scheduled to be
* removed in June 2018.
*/
@Deprecated
public static final CharMatcher JAVA_LETTER = javaLetter();

/**
* Determines whether a character is a letter or digit according to
* {@linkplain Character#isLetterOrDigit(char) Java's definition}.
*
* @deprecated Use {@link #javaLetterOrDigit()} instead. This constant is scheduled
* to be removed in June 2018.
*/
@Deprecated
public static final CharMatcher JAVA_LETTER_OR_DIGIT = javaLetterOrDigit();

/**
* Determines whether a character is upper case according to
* {@linkplain Character#isUpperCase(char) Java's definition}.
*
* @deprecated Use {@link #javaUpperCase()} instead. This constant is scheduled to
* be removed in June 2018.
*/
@Deprecated
public static final CharMatcher JAVA_UPPER_CASE = javaUpperCase();

/**
* Determines whether a character is lower case according to
* {@linkplain Character#isLowerCase(char) Java's definition}.
*
* @deprecated Use {@link #javaLowerCase()} instead. This constant is scheduled to
* be removed in June 2018.
*/
@Deprecated
public static final CharMatcher JAVA_LOWER_CASE = javaLowerCase();

/**
* Determines whether a character is an ISO control character as specified by
* {@link Character#isISOControl(char)}.
*
* @deprecated Use {@link #javaIsoControl()} instead. This constant is scheduled to
* be removed in June 2018.
*/
@Deprecated
public static final CharMatcher JAVA_ISO_CONTROL = javaIsoControl();

/**
* Determines whether a character is invisible; that is, if its Unicode category is
* any of SPACE_SEPARATOR, LINE_SEPARATOR, PARAGRAPH_SEPARATOR, CONTROL, FORMAT,
* SURROGATE, and PRIVATE_USE according to ICU4J.
*
* @deprecated Use {@link #invisible()} instead. This constant is scheduled to be
* removed in June 2018.
*/
@Deprecated
public static final CharMatcher INVISIBLE = invisible();

/**
Expand All @@ -301,13 +343,29 @@ public static CharMatcher singleWidth() {
*
* <p><b>Note:</b> as the reference file evolves, we will modify this constant to
* keep it up to date.
*
* @deprecated Use {@link #singleWidth()} instead. This constant is scheduled to be
* removed in June 2018.
*/
@Deprecated
public static final CharMatcher SINGLE_WIDTH = singleWidth();

/** Matches any character. */
/**
* Matches any character.
*
* @deprecated Use {@link #any()} instead. This constant is scheduled to be
* removed in June 2018.
*/
@Deprecated
public static final CharMatcher ANY = any();

/** Matches no characters. */
/**
* Matches no characters.
*
* @deprecated Use {@link #none()} instead. This constant is scheduled to be
* removed in June 2018.
*/
@Deprecated
public static final CharMatcher NONE = none();

// Static factories
Expand Down

0 comments on commit 94f1bf0

Please sign in to comment.