Package hydra.build.format
Class RepositoryDescriptor
- java.lang.Object
-
- hydra.build.format.RepositoryDescriptor
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<RepositoryDescriptor>
public class RepositoryDescriptor extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<RepositoryDescriptor>
The repository descriptor (hydra.json at the repository root): release and host versions, host consumption overrides, publication metadata, and the list of source packages.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRepositoryDescriptor.BuilderA fluent builder forRepositoryDescriptor.
-
Field Summary
Fields Modifier and Type Field Description java.lang.StringauthorThe author attribution for published artifactsstatic NameAUTHORName of thehydra.build.format.RepositoryDescriptor.authorfield.static NameCURRENT_VERSIONName of thehydra.build.format.RepositoryDescriptor.currentVersionfield.VersioncurrentVersionThe version currently under developmentjava.lang.StringgroupThe group identifier under which artifacts are published, e.g.static NameGROUPName of thehydra.build.format.RepositoryDescriptor.groupfield.static NameHOST_OVERRIDESName of thehydra.build.format.RepositoryDescriptor.hostOverridesfield.static NameHOST_VERSIONName of thehydra.build.format.RepositoryDescriptor.hostVersionfield.java.util.Map<LanguageName,HostOverride>hostOverridesPer-host-language overrides of the default published-host consumptionVersionhostVersionThe published host version consumed by default when generating codejava.lang.StringlicenseThe license identifier for published artifacts, e.g.static NameLICENSEName of thehydra.build.format.RepositoryDescriptor.licensefield.java.util.List<PackageName>packagesThe names of the repository's source packagesstatic NamePACKAGESName of thehydra.build.format.RepositoryDescriptor.packagesfield.static NameTYPE_Name of thehydra.build.format.RepositoryDescriptortype.java.lang.StringurlThe URL of the projectstatic NameURLName of thehydra.build.format.RepositoryDescriptor.urlfield.
-
Constructor Summary
Constructors Constructor Description RepositoryDescriptor(Version currentVersion, Version hostVersion, java.util.Map<LanguageName,HostOverride> hostOverrides, java.lang.String group, java.lang.String author, java.lang.String url, java.lang.String license, java.util.List<PackageName> packages)Constructs an immutableRepositoryDescriptor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RepositoryDescriptor.Builderbuilder()Creates a new fluent builder forRepositoryDescriptor.intcompareTo(RepositoryDescriptor other)booleanequals(java.lang.Object other)inthashCode()java.lang.StringtoString()RepositoryDescriptorwithAuthor(java.lang.String author)Returns a copy of thisRepositoryDescriptorwithauthorreplaced.RepositoryDescriptorwithCurrentVersion(Version currentVersion)Returns a copy of thisRepositoryDescriptorwithcurrentVersionreplaced.RepositoryDescriptorwithGroup(java.lang.String group)Returns a copy of thisRepositoryDescriptorwithgroupreplaced.RepositoryDescriptorwithHostOverrides(java.util.Map<LanguageName,HostOverride> hostOverrides)Returns a copy of thisRepositoryDescriptorwithhostOverridesreplaced.RepositoryDescriptorwithHostVersion(Version hostVersion)Returns a copy of thisRepositoryDescriptorwithhostVersionreplaced.RepositoryDescriptorwithLicense(java.lang.String license)Returns a copy of thisRepositoryDescriptorwithlicensereplaced.RepositoryDescriptorwithPackages(java.util.List<PackageName> packages)Returns a copy of thisRepositoryDescriptorwithpackagesreplaced.RepositoryDescriptorwithUrl(java.lang.String url)Returns a copy of thisRepositoryDescriptorwithurlreplaced.
-
-
-
Field Detail
-
TYPE_
public static final Name TYPE_
Name of thehydra.build.format.RepositoryDescriptortype.
-
CURRENT_VERSION
public static final Name CURRENT_VERSION
Name of thehydra.build.format.RepositoryDescriptor.currentVersionfield.
-
HOST_VERSION
public static final Name HOST_VERSION
Name of thehydra.build.format.RepositoryDescriptor.hostVersionfield.
-
HOST_OVERRIDES
public static final Name HOST_OVERRIDES
Name of thehydra.build.format.RepositoryDescriptor.hostOverridesfield.
-
GROUP
public static final Name GROUP
Name of thehydra.build.format.RepositoryDescriptor.groupfield.
-
AUTHOR
public static final Name AUTHOR
Name of thehydra.build.format.RepositoryDescriptor.authorfield.
-
URL
public static final Name URL
Name of thehydra.build.format.RepositoryDescriptor.urlfield.
-
LICENSE
public static final Name LICENSE
Name of thehydra.build.format.RepositoryDescriptor.licensefield.
-
PACKAGES
public static final Name PACKAGES
Name of thehydra.build.format.RepositoryDescriptor.packagesfield.
-
currentVersion
public final Version currentVersion
The version currently under development
-
hostVersion
public final Version hostVersion
The published host version consumed by default when generating code
-
hostOverrides
public final java.util.Map<LanguageName,HostOverride> hostOverrides
Per-host-language overrides of the default published-host consumption
-
group
public final java.lang.String group
The group identifier under which artifacts are published, e.g. a Maven group id
-
author
public final java.lang.String author
The author attribution for published artifacts
-
url
public final java.lang.String url
The URL of the project
-
license
public final java.lang.String license
The license identifier for published artifacts, e.g. "Apache-2.0"
-
packages
public final java.util.List<PackageName> packages
The names of the repository's source packages
-
-
Constructor Detail
-
RepositoryDescriptor
public RepositoryDescriptor(Version currentVersion, Version hostVersion, java.util.Map<LanguageName,HostOverride> hostOverrides, java.lang.String group, java.lang.String author, java.lang.String url, java.lang.String license, java.util.List<PackageName> packages)
Constructs an immutableRepositoryDescriptor.- Parameters:
currentVersion- The version currently under developmenthostVersion- The published host version consumed by default when generating codehostOverrides- Per-host-language overrides of the default published-host consumptiongroup- The group identifier under which artifacts are published, e.g. a Maven group idauthor- The author attribution for published artifactsurl- The URL of the projectlicense- The license identifier for published artifacts, e.g. "Apache-2.0"packages- The names of the repository's source packages
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(RepositoryDescriptor other)
- Specified by:
compareToin interfacejava.lang.Comparable<RepositoryDescriptor>
-
withCurrentVersion
public RepositoryDescriptor withCurrentVersion(Version currentVersion)
Returns a copy of thisRepositoryDescriptorwithcurrentVersionreplaced.
-
withHostVersion
public RepositoryDescriptor withHostVersion(Version hostVersion)
Returns a copy of thisRepositoryDescriptorwithhostVersionreplaced.
-
withHostOverrides
public RepositoryDescriptor withHostOverrides(java.util.Map<LanguageName,HostOverride> hostOverrides)
Returns a copy of thisRepositoryDescriptorwithhostOverridesreplaced.
-
withGroup
public RepositoryDescriptor withGroup(java.lang.String group)
Returns a copy of thisRepositoryDescriptorwithgroupreplaced.
-
withAuthor
public RepositoryDescriptor withAuthor(java.lang.String author)
Returns a copy of thisRepositoryDescriptorwithauthorreplaced.
-
withUrl
public RepositoryDescriptor withUrl(java.lang.String url)
Returns a copy of thisRepositoryDescriptorwithurlreplaced.
-
withLicense
public RepositoryDescriptor withLicense(java.lang.String license)
Returns a copy of thisRepositoryDescriptorwithlicensereplaced.
-
withPackages
public RepositoryDescriptor withPackages(java.util.List<PackageName> packages)
Returns a copy of thisRepositoryDescriptorwithpackagesreplaced.
-
builder
public static RepositoryDescriptor.Builder builder()
Creates a new fluent builder forRepositoryDescriptor.
-
-