Class JvmIdentifier
- Namespace
- TypedRest.CodeGeneration.Jvm.Model
- Assembly
- TypedRest.CodeGeneration.Jvm.dll
A reference to a JVM type.
public sealed class JvmIdentifier
- Inheritance
-
objectJvmIdentifier
Constructors
JvmIdentifier(JvmPackage?, string, bool)
Creates a new type reference.
public JvmIdentifier(JvmPackage? package, string name, bool nullable = false)
Parameters
packageJvmPackageThe package the type lives in, or
nullfor a primitive/built-in.namestringThe simple name of the type.
nullableboolIndicates whether the type can have the value
null.
Properties
Boolean
The boxed java.lang.Boolean type.
public static JvmIdentifier Boolean { get; }
Property Value
Double
The boxed java.lang.Double type.
public static JvmIdentifier Double { get; }
Property Value
InputStream
The java.io.InputStream type, used for blob and upload endpoints.
public static JvmIdentifier InputStream { get; }
Property Value
Int
The boxed java.lang.Integer type.
public static JvmIdentifier Int { get; }
Property Value
Interface
The interface this type implements, or null if it implements none.
public JvmIdentifier? Interface { get; }
Property Value
InterfaceName
The simple name of the interface this type implements, or null if it implements none.
public string? InterfaceName { get; }
Property Value
Remarks
The interface lives in the same package and takes the same type arguments.
Kind
What kind of type this is, for the cases the writers have to treat specially.
public JvmTypeKind Kind { get; }
Property Value
LocalDate
The java.time.LocalDate type, used for date formats.
public static JvmIdentifier LocalDate { get; }
Property Value
Long
The boxed java.lang.Long type.
public static JvmIdentifier Long { get; }
Property Value
Name
The simple name of the type, without the package.
public string Name { get; }
Property Value
Nullable
Indicates whether the type can have the value null.
public bool Nullable { get; }
Property Value
Object
The fallback for schemas that carry no usable type information.
public static JvmIdentifier Object { get; }
Property Value
OffsetDateTime
The java.time.OffsetDateTime type, used for date-time formats.
public static JvmIdentifier OffsetDateTime { get; }
Property Value
Package
The package the type lives in, or null for a primitive/built-in.
public JvmPackage? Package { get; }
Property Value
QualifiedName
The fully qualified name, e.g. java.util.List.
public string QualifiedName { get; }
Property Value
String
The java.lang.String type.
public static JvmIdentifier String { get; }
Property Value
TypeArguments
Generic type arguments for the type.
public List<JvmIdentifier> TypeArguments { get; }
Property Value
Uri
The java.net.URI type, which every endpoint constructor takes.
public static JvmIdentifier Uri { get; }
Property Value
Uuid
The java.util.UUID type, used for uuid formats.
public static JvmIdentifier Uuid { get; }
Property Value
Methods
GetImports()
Returns every type that has to be imported to reference this type.
public IEnumerable<JvmIdentifier> GetImports()
Returns
Implementing(string)
Returns a copy of the type reference that implements the interface name.
public JvmIdentifier Implementing(string name)
Parameters
namestring
Returns
ListOf(JvmIdentifier)
A java.util.List of item.
public static JvmIdentifier ListOf(JvmIdentifier item)
Parameters
itemJvmIdentifier
Returns
MapOf(JvmIdentifier)
A java.util.Map from String to value.
public static JvmIdentifier MapOf(JvmIdentifier value)
Parameters
valueJvmIdentifier
Returns
ToNonNullable()
Returns a copy of the type reference that cannot have the value null.
public JvmIdentifier ToNonNullable()
Returns
ToNullable()
Returns a copy of the type reference that can have the value null.
public JvmIdentifier ToNullable()
Returns
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
WithName(string)
Returns a copy of the type reference under a different name, keeping its package and type arguments.
public JvmIdentifier WithName(string name)
Parameters
namestring
Returns
WithTypeArguments(params JvmIdentifier[])
Returns a copy of the type reference with typeArguments applied.
public JvmIdentifier WithTypeArguments(params JvmIdentifier[] typeArguments)
Parameters
typeArgumentsJvmIdentifier[]