diff --git a/core/src/main/java/org/wildfly/channel/BlocklistCoordinate.java b/core/src/main/java/org/wildfly/channel/BlocklistCoordinate.java index 7f4fddcc..56599589 100644 --- a/core/src/main/java/org/wildfly/channel/BlocklistCoordinate.java +++ b/core/src/main/java/org/wildfly/channel/BlocklistCoordinate.java @@ -42,6 +42,10 @@ public BlocklistCoordinate(String groupId, String artifactId, String version) { public BlocklistCoordinate(URL url) { super(url); } + + public BlocklistCoordinate() { + super(BlocklistCoordinate.CLASSIFIER, BlocklistCoordinate.EXTENSION); + } @JsonCreator public static BlocklistCoordinate create(@JsonProperty(value = "maven") MavenCoordinate coord, diff --git a/core/src/main/java/org/wildfly/channel/Channel.java b/core/src/main/java/org/wildfly/channel/Channel.java index 547eddd3..16e6193c 100644 --- a/core/src/main/java/org/wildfly/channel/Channel.java +++ b/core/src/main/java/org/wildfly/channel/Channel.java @@ -9,6 +9,7 @@ import java.util.List; import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY; +import java.util.ArrayList; import static java.util.Collections.emptyList; public class Channel { @@ -38,14 +39,14 @@ public class Channel { * This is an optional field. */ private Vendor vendor; - private List repositories; + private List repositories = new ArrayList<>(); private BlocklistCoordinate blocklistCoordinate; private ChannelManifestCoordinate manifestCoordinate; - private NoStreamStrategy noStreamStrategy; + private NoStreamStrategy noStreamStrategy = NoStreamStrategy.ORIGINAL; // no-arg constructor for maven plugins public Channel() { - + schemaVersion = ChannelMapper.CURRENT_SCHEMA_VERSION; } /** @@ -94,30 +95,37 @@ public String getSchemaVersion() { return schemaVersion; } + @JsonInclude(JsonInclude.Include.NON_NULL) public String getName() { return name; } + @JsonInclude(JsonInclude.Include.NON_NULL) public String getDescription() { return description; } + @JsonInclude(JsonInclude.Include.NON_NULL) public Vendor getVendor() { return vendor; } + @JsonInclude(JsonInclude.Include.NON_EMPTY) public List getRepositories() { return repositories; } + @JsonInclude(JsonInclude.Include.NON_NULL) public BlocklistCoordinate getBlocklistCoordinate() { return blocklistCoordinate; } + @JsonInclude(JsonInclude.Include.NON_NULL) public ChannelManifestCoordinate getManifestCoordinate() { return manifestCoordinate; } + @JsonInclude(JsonInclude.Include.NON_NULL) public NoStreamStrategy getNoStreamStrategy() { return noStreamStrategy; } diff --git a/core/src/main/java/org/wildfly/channel/ChannelManifestCoordinate.java b/core/src/main/java/org/wildfly/channel/ChannelManifestCoordinate.java index 59f60f4c..8b4efcc1 100644 --- a/core/src/main/java/org/wildfly/channel/ChannelManifestCoordinate.java +++ b/core/src/main/java/org/wildfly/channel/ChannelManifestCoordinate.java @@ -45,6 +45,10 @@ public ChannelManifestCoordinate(URL url) { super(url); } + public ChannelManifestCoordinate() { + super(ChannelManifest.CLASSIFIER, ChannelManifest.EXTENSION); + } + @JsonCreator public static ChannelManifestCoordinate create(@JsonProperty(value = "url") String url, @JsonProperty(value = "maven") MavenCoordinate gav) throws MalformedURLException { if (gav != null) { diff --git a/core/src/main/java/org/wildfly/channel/Repository.java b/core/src/main/java/org/wildfly/channel/Repository.java index ece69938..a0f4b69e 100644 --- a/core/src/main/java/org/wildfly/channel/Repository.java +++ b/core/src/main/java/org/wildfly/channel/Repository.java @@ -46,10 +46,18 @@ public Repository(@JsonProperty(value = "id", required = true) String id, @JsonP this.url = url; } + public Repository() { + + } + public String getId() { return id; } + public void setUrl(String url) { + this.url = url; + } + public String getUrl() { return url; } diff --git a/core/src/main/java/org/wildfly/channel/Vendor.java b/core/src/main/java/org/wildfly/channel/Vendor.java index ad054d3c..e1384b8b 100644 --- a/core/src/main/java/org/wildfly/channel/Vendor.java +++ b/core/src/main/java/org/wildfly/channel/Vendor.java @@ -27,12 +27,12 @@ public class Vendor { /** * Name of the vendor. */ - private final String name; + private String name; /** * Support level provided by the vendor. */ - private final Support support; + private Support support; /** * Vendor resource @@ -46,6 +46,9 @@ public Vendor(@JsonProperty(value = "name", required = true) String name, @JsonP this.support = support; } + public Vendor() { + } + public String getName() { return name; }