17 public static implicit
operator JavaTypeName(
string typeName) =>
new(typeName);
19 public static implicit
operator ReadOnlyMemory<char>(
JavaTypeName typeName) => typeName.value;
20 public static implicit
operator JavaTypeName(ReadOnlyMemory<char> typeName) =>
new(typeName);
25 readonly ReadOnlyMemory<char>
value;
32 this(
value.AsMemory())
35 throw new ArgumentNullException(nameof(
value));
53 this(package.
IsEmpty ? name.
Value : (package +
'.' + name).AsMemory())
79 var i =
value.Span.LastIndexOf(
'.');
98 var index =
value.Span.LastIndexOf(
'.');
118 var index =
value.Span.LastIndexOfAny(
'.',
'$');
156 var b =
value.Span.LastIndexOf(
'$');
172 public override bool Equals(
object obj) =>
false;
Provides methods to parse a Java package name.
Provides methods to parse a Java class simple name.
static JavaSimpleTypeName Empty
Provides methods to parse a Java class name.
override int GetHashCode()
Gets the hash code of this type name.
override bool Equals(object obj)
Returns true if the two objects are equal.
JavaUnqualifiedTypeName UnqualifiedName
Gets the unqualified type name.
static bool operator!=(JavaTypeName a, JavaTypeName b)
override string ToString()
Returns a string instance of the type name.
JavaPackageName PackageName
Gets the package name.
JavaPackageName GetPackageName()
Gets the package name.
bool IsMemberOf(JavaPackageName packageName)
Returns true if this type is a member of the given package.
bool Equals(JavaTypeName other)
Returns true if the two objects are equal.
JavaTypeName(JavaPackageName package, JavaUnqualifiedTypeName name)
Initializes a new instance.
bool IsInnerClass
Returns true if this name represents an inner class of another class.
JavaTypeName(string value)
Initializes a new instance.
static bool operator==(JavaTypeName a, JavaTypeName b)
bool IsAnonymousClass
Returns true if this name represents an anonymous class.
JavaTypeName(ReadOnlyMemory< char > value)
Initializes a new instance.
JavaSimpleTypeName SimpleName
Gets the simple name.
static JavaTypeName Empty
readonly ReadOnlyMemory< char > value
ReadOnlyMemory< char > Value
Gets the underlying value of the type name.
JavaUnqualifiedTypeName GetUnqualifiedName()
Gets the unqualified type name.
bool IsNestedClass
Returns true if this name represents a nested class.
JavaSimpleTypeName GetSimpleName()
Gets the simple name.
JavaTypeName Parent
If this class name is a nested, inner or anonymous class, returns the parent class name,...
bool IsEmpty
Returns true if this represents the empty type name.
bool IsLocalClass
Returns true if this name represents a local class.
Provides methods to parse a Java class name without package.
bool IsAnonymousClass
Returns true if this name represents an anonymous class.
bool IsInnerClass
Returns true if this name represents an inner class of another class.
bool IsLocalClass
Returns true if this name represents a local class.
bool IsNestedClass
Returns true if this name represents a nested class.