public class AndroidxName
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
java.lang.String |
defaultName()
Returns the
com.android.support version of the name. |
boolean |
isEquals(java.lang.String strName)
Compares the current name with the given string
|
boolean |
isEqualsIgnoreCase(java.lang.String strName)
Compares the current name with the given string ignoring case sensitivity
|
boolean |
isPrefix(java.lang.String name)
Returns if the current name is a prefix of the given name.
|
boolean |
isPrefix(java.lang.String name,
boolean strict)
Returns if the current name is a prefix of the given name.
|
java.lang.String |
newName()
Returns the
androidx version of the name |
static AndroidxName |
of(AndroidxName pkg,
java.lang.String simpleClassName)
Creates a new instance for the given package and class name
|
static AndroidxName |
of(java.lang.String oldPackageName)
Creates a new package instance for for the package in the
com.android.support |
static AndroidxName |
of(java.lang.String oldPackage,
java.lang.String simpleClassName)
Creates a new instance for the package in the
com.android.support and class name |
java.lang.String |
oldName()
Returns the
com.android.support version of the name |
java.lang.String |
removeFrom(java.lang.String qualifiedName)
Removes the current name from the given qualified name.
|
java.lang.String |
toString() |
@NonNull public static AndroidxName of(@NonNull java.lang.String oldPackage, @NonNull java.lang.String simpleClassName)
com.android.support
and class name@NonNull public static AndroidxName of(@NonNull AndroidxName pkg, @NonNull java.lang.String simpleClassName)
@NonNull public static AndroidxName of(@NonNull java.lang.String oldPackageName)
com.android.support
@NonNull public java.lang.String oldName()
com.android.support
version of the name@NonNull public java.lang.String newName()
androidx
version of the name@NonNull public java.lang.String defaultName()
public boolean isPrefix(@Nullable java.lang.String name)
public boolean isPrefix(@Nullable java.lang.String name, boolean strict)
name
- the name to checkstrict
- true if the name needs to be strictly longer than the prefixpublic java.lang.String removeFrom(@NonNull java.lang.String qualifiedName)
For example, if the AndroidxName
is "android" and the passed qualifiedName is
"android.TestClass", this method, will return "TestClass"
public boolean isEquals(@Nullable java.lang.String strName)
public boolean isEqualsIgnoreCase(@Nullable java.lang.String strName)
public java.lang.String toString()
toString
in class java.lang.Object