Class JvmPackage
- Namespace
- TypedRest.CodeGeneration.Jvm.Model
- Assembly
- TypedRest.CodeGeneration.Jvm.dll
A JVM package, e.g. net.typedrest.endpoints.generic.
public sealed class JvmPackage : IEquatable<JvmPackage>
- Inheritance
-
objectJvmPackage
- Implements
Constructors
JvmPackage(string, bool)
Creates a package from a dotted name.
public JvmPackage(string name, bool generated = false)
Parameters
namestringThe dotted package name. May be empty for the default package.
generatedboolWhether this package is generated by this tool rather than coming from a library.
Properties
Directory
The directory this package's files go in, relative to the source root, using / as the separator.
public string Directory { get; }
Property Value
Generated
Indicates whether this package holds types generated by this tool, as opposed to library types.
public bool Generated { get; }
Property Value
Name
The dotted package name. Empty for the default package.
public string Name { get; }
Property Value
Methods
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current object.
Returns
Equals(JvmPackage?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(JvmPackage? other)
Parameters
otherJvmPackageAn object to compare with this object.
Returns
External(string)
A package belonging to the TypedRest runtime library or the JDK.
public static JvmPackage External(string name)
Parameters
namestring
Returns
FilePath(string, string)
The path of a file holding typeName in this package, including the extension.
public string FilePath(string typeName, string extension)
Parameters
Returns
ForGenerated(string)
A package holding types generated by this tool.
public static JvmPackage ForGenerated(string name)
Parameters
namestring
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
Sanitize(string?)
Turns a namespace-style value such as MyCompany.MyService into a valid package name.
public static string Sanitize(string? value)
Parameters
valuestring
Returns
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.