package io.fd.hc2vpp.docs.api;
+import static java.util.Objects.requireNonNull;
+
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.Set;
+import javax.annotation.Nonnull;
/**
* Represents mapping between single supported VPP binary api and its binding
*/
-public class CoverageUnit {
+public class CoverageUnit implements Comparable<CoverageUnit> {
/**
* VPP binary api reference
*/
private final Collection<Operation> supportedOperations;
- private CoverageUnit(final VppApiMessage vppApi, final JavaApiMessage javaApi,
- final List<YangType> yangTypes,
- final Collection<Operation> supportedOperations) {
- this.vppApi = vppApi;
- this.javaApi = javaApi;
- this.yangTypes = yangTypes;
- this.supportedOperations = supportedOperations;
+ private CoverageUnit(@Nonnull final VppApiMessage vppApi, @Nonnull final JavaApiMessage javaApi,
+ @Nonnull final List<YangType> yangTypes,
+ @Nonnull final Collection<Operation> supportedOperations) {
+ this.vppApi = requireNonNull(vppApi, "vppApi should not be null");
+ this.javaApi = requireNonNull(javaApi, "javaApi should not be null");
+ this.yangTypes = requireNonNull(yangTypes, "yangTypes should not be null");
+ this.supportedOperations = requireNonNull(supportedOperations, "supportedOperations should not be null");
}
public VppApiMessage getVppApi() {
return Objects.hash(vppApi, javaApi, yangTypes, supportedOperations);
}
+ @Override
+ public int compareTo(final CoverageUnit o) {
+ return vppApi.getName().compareTo(o.getVppApi().getName());
+ }
+
public static class CoverageUnitBuilder {
private VppApiMessage vppApi;
private JavaApiMessage javaApi;
package io.fd.hc2vpp.docs.api;
+import static java.util.Objects.requireNonNull;
+
import java.util.Objects;
+import javax.annotation.Nonnull;
/**
* Represents reference to VPP binary api
// TODO - check if possible to add direct link for specific api
private final String link;
- public VppApiMessage(final String name, final String link) {
- this.name = name;
- this.link = link;
+ public VppApiMessage(@Nonnull final String name, @Nonnull final String link) {
+ this.name = requireNonNull(name, "name should not be null");
+ this.link = requireNonNull(link, "link should not be null");
}
public String getName() {