summaryrefslogtreecommitdiffstats
path: root/model/context-model/src/main/java/org
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@ericsson.com>2018-09-10 17:05:36 +0100
committerliamfallon <liam.fallon@ericsson.com>2018-09-10 17:07:47 +0100
commitd100854291559df1426ea1e64351872ae2d3867b (patch)
tree78baab90111307cd3d2460b2cca37e93a20ac9a3 /model/context-model/src/main/java/org
parent8f82d7adcb53b349e14d3b356bda03588a554f95 (diff)
Checkstyle changes for apex model
Fix checkstyle warnings in the apex mode and knock on changes. Issue-ID: POLICY-1034 Change-Id: I10537e4288e9cad5ef18165ed2cdc1d3ab3139c1 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Diffstat (limited to 'model/context-model/src/main/java/org')
-rw-r--r--model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextAlbum.java54
-rw-r--r--model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextAlbums.java81
-rw-r--r--model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextModel.java6
-rw-r--r--model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextSchema.java30
-rw-r--r--model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextSchemas.java38
5 files changed, 105 insertions, 104 deletions
diff --git a/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextAlbum.java b/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextAlbum.java
index 32555662e..564e2d48c 100644
--- a/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextAlbum.java
+++ b/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextAlbum.java
@@ -46,22 +46,22 @@ import org.onap.policy.apex.model.utilities.Assertions;
/**
* This class is used to define an album of context.
- * <p>
- * A context album is a distributed map of context that will be distributed across all process instances that require
+ *
+ * <p>A context album is a distributed map of context that will be distributed across all process instances that require
* access to it. This class defines the schema (structure) of the items in the context album, whether the items on the
* context album are writable or not, and what the scope of the context album is.
- * <p>
- * The structure of items (objects) the context album is defined as a schema, which is understood by whatever schema
+ *
+ * <p>The structure of items (objects) the context album is defined as a schema, which is understood by whatever schema
* implementation is being used for the context album.
- * <p>
- * The scope of a context album is a string field, understood by whatever distribution mechanism is being used for the
- * context album. The distribution mechanism uses the scope of the context album to decide to which executable entities
- * a given context album is distributed.
- * <p>
- * The writable flag on a context album defines whether users of a context album can write to the context album or just
- * read objects from the context album.
- * <p>
- * Validation checks that the album key and the context schema key are not null and that the scope field is not
+ *
+ * <p>The scope of a context album is a string field, understood by whatever distribution mechanism is being used for
+ * the context album. The distribution mechanism uses the scope of the context album to decide to which executable
+ * entities a given context album is distributed.
+ *
+ * <p>The writable flag on a context album defines whether users of a context album can write to the context album or
+ * just read objects from the context album.
+ *
+ * <p>Validation checks that the album key and the context schema key are not null and that the scope field is not
* undefined and matches the regular expression SCOPE_REGEXP.
*/
@Entity
@@ -69,8 +69,8 @@ import org.onap.policy.apex.model.utilities.Assertions;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "apexContextAlbum", namespace = "http://www.onap.org/policy/apex-pdp")
-@XmlType(name = "AxContextAlbum", namespace = "http://www.onap.org/policy/apex-pdp",
- propOrder = { "key", "scope", "isWritable", "itemSchema" })
+@XmlType(name = "AxContextAlbum", namespace = "http://www.onap.org/policy/apex-pdp", propOrder =
+ { "key", "scope", "isWritable", "itemSchema" })
public class AxContextAlbum extends AxConcept {
private static final String SCOPE_STRING = "scope";
@@ -113,8 +113,8 @@ public class AxContextAlbum extends AxConcept {
/**
* The default constructor creates a context album with a null artifact key. The scope of the context album is set
- * as SCOPE_UNDEFINED, the album is writable, and the artifact key of the context schema is set to the null
- * artifact key.
+ * as SCOPE_UNDEFINED, the album is writable, and the artifact key of the context schema is set to the null artifact
+ * key.
*/
public AxContextAlbum() {
this(new AxArtifactKey());
@@ -124,7 +124,7 @@ public class AxContextAlbum extends AxConcept {
}
/**
- * Copy constructor
+ * Copy constructor.
*
* @param copyConcept the concept to copy from
*/
@@ -134,8 +134,8 @@ public class AxContextAlbum extends AxConcept {
/**
* The keyed constructor creates a context album with the specified artifact key. The scope of the context album is
- * set as SCOPE_UNDEFINED, the album is writable, and the artifact key of the context schema is set to the
- * null artifact key.
+ * set as SCOPE_UNDEFINED, the album is writable, and the artifact key of the context schema is set to the null
+ * artifact key.
*
* @param key the key of the context album
*/
@@ -152,7 +152,7 @@ public class AxContextAlbum extends AxConcept {
* @param itemSchema the artifact key of the context schema to use for this context album
*/
public AxContextAlbum(final AxArtifactKey key, final String scope, final boolean isWritable,
- final AxArtifactKey itemSchema) {
+ final AxArtifactKey itemSchema) {
super();
Assertions.argumentNotNull(key, "key may not be null");
Assertions.argumentNotNull(scope, "scope may not be null");
@@ -264,26 +264,26 @@ public class AxContextAlbum extends AxConcept {
AxValidationResult result = resultIn;
if (key.equals(AxArtifactKey.getNullKey())) {
- result.addValidationMessage(
- new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID, "key is a null key"));
+ result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
+ "key is a null key"));
}
result = key.validate(result);
if (scope.replaceAll("\\s+$", "").length() == 0 || scope.equals(SCOPE_UNDEFINED)) {
- result.addValidationMessage(
- new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID, "scope is not defined"));
+ result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
+ "scope is not defined"));
}
try {
Assertions.validateStringParameter(SCOPE_STRING, scope, SCOPE_REGEXP);
} catch (final IllegalArgumentException e) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "scope invalid-" + e.getMessage()));
+ "scope invalid-" + e.getMessage()));
}
if (itemSchema.equals(AxArtifactKey.getNullKey())) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "itemSchema reference is a null key, an item schema must be specified"));
+ "itemSchema reference is a null key, an item schema must be specified"));
}
result = itemSchema.validate(result);
diff --git a/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextAlbums.java b/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextAlbums.java
index a6e2ad9ac..9df11ae25 100644
--- a/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextAlbums.java
+++ b/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextAlbums.java
@@ -51,22 +51,22 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult.Validat
import org.onap.policy.apex.model.utilities.Assertions;
/**
- * This class is a context album container and holds a map of the context albums for an entire Apex
- * model. All Apex models that use context albums must have an {@link AxContextAlbums} field. The
- * {@link AxContextAlbums} class implements the helper methods of the {@link AxConceptGetter}
- * interface to allow {@link AxContextAlbum} instances to be retrieved by calling methods directly
- * on this class without referencing the contained map.
- * <p>
- * Validation checks that the container key is not null. An observation is issued if no context
- * albums are defined in the container. If context albums do exist, they are checked to ensure that
- * keys and values are not null and that the map key matches the key in the map value for all album
- * entries. Each context album entry is then validated individually.
+ * This class is a context album container and holds a map of the context albums for an entire Apex model. All Apex
+ * models that use context albums must have an {@link AxContextAlbums} field. The {@link AxContextAlbums} class
+ * implements the helper methods of the {@link AxConceptGetter} interface to allow {@link AxContextAlbum} instances to
+ * be retrieved by calling methods directly on this class without referencing the contained map.
+ *
+ * <p>Validation checks that the container key is not null. An observation is issued if no context albums are defined in
+ * the container. If context albums do exist, they are checked to ensure that keys and values are not null and that the
+ * map key matches the key in the map value for all album entries. Each context album entry is then validated
+ * individually.
*/
@Entity
@Table(name = "AxContextAlbums")
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "AxContextAlbums", namespace = "http://www.onap.org/policy/apex-pdp", propOrder = {"key", "albums"})
+@XmlType(name = "AxContextAlbums", namespace = "http://www.onap.org/policy/apex-pdp", propOrder =
+ { "key", "albums" })
public final class AxContextAlbums extends AxConcept implements AxConceptGetter<AxContextAlbum> {
private static final long serialVersionUID = -4844259809024470975L;
@@ -84,15 +84,15 @@ public final class AxContextAlbums extends AxConcept implements AxConceptGetter<
// @formatter:on
/**
- * The Default Constructor creates a {@link AxContextAlbums} object with a null artifact key and
- * creates an empty context album map.
+ * The Default Constructor creates a {@link AxContextAlbums} object with a null artifact key and creates an empty
+ * context album map.
*/
public AxContextAlbums() {
this(new AxArtifactKey());
}
/**
- * Copy constructor
+ * Copy constructor.
*
* @param copyConcept the concept to copy from
*/
@@ -101,8 +101,8 @@ public final class AxContextAlbums extends AxConcept implements AxConceptGetter<
}
/**
- * The Key Constructor creates a {@link AxContextAlbums} object with the given artifact key and
- * creates an empty context album map.
+ * The Key Constructor creates a {@link AxContextAlbums} object with the given artifact key and creates an empty
+ * context album map.
*
* @param key the key of the context album container
*/
@@ -127,15 +127,14 @@ public final class AxContextAlbums extends AxConcept implements AxConceptGetter<
}
/**
- * When a model is unmarshalled from disk or from the database, the context album map is
- * returned as a raw hash map. This method is called by JAXB after unmarshaling and is used to
- * convert the hash map to a {@link NavigableMap} so that it will work with the
- * {@link AxConceptGetter} interface.
+ * When a model is unmarshalled from disk or from the database, the context album map is returned as a raw hash map.
+ * This method is called by JAXB after unmarshaling and is used to convert the hash map to a {@link NavigableMap} so
+ * that it will work with the {@link AxConceptGetter} interface.
*
- * @param u the unmarshaler that is unmarshaling the model
+ * @param unmarsaller the unmarshaler that is unmarshaling the model
* @param parent the parent object of this object in the unmarshaler
*/
- public void afterUnmarshal(final Unmarshaller u, final Object parent) {
+ public void afterUnmarshal(final Unmarshaller unmarsaller, final Object parent) {
// The map must be navigable to allow name and version searching, unmarshaling returns a
// hash map
final NavigableMap<AxArtifactKey, AxContextAlbum> navigableAlbums = new TreeMap<>();
@@ -236,8 +235,7 @@ public final class AxContextAlbums extends AxConcept implements AxConceptGetter<
/*
* (non-Javadoc)
*
- * @see
- * org.onap.policy.apex.model.basicmodel.concepts.AxConcept#validate(org.onap.policy.apex.model.
+ * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#validate(org.onap.policy.apex.model.
* basicmodel.concepts.AxValidationResult)
*/
@Override
@@ -245,23 +243,24 @@ public final class AxContextAlbums extends AxConcept implements AxConceptGetter<
AxValidationResult result = resultIn;
if (key.equals(AxArtifactKey.getNullKey())) {
- result.addValidationMessage(
- new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID, "key is a null key"));
+ result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
+ "key is a null key"));
}
result = key.validate(result);
if (albums.size() == 0) {
- result.addValidationMessage(
- new AxValidationMessage(key, this.getClass(), ValidationResult.OBSERVATION, "albums are empty"));
+ result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.OBSERVATION,
+ "albums are empty"));
} else {
for (final Entry<AxArtifactKey, AxContextAlbum> contextAlbumEntry : albums.entrySet()) {
if (contextAlbumEntry.getKey().equals(AxArtifactKey.getNullKey())) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "key on context album entry " + contextAlbumEntry.getKey() + " may not be the null key"));
+ "key on context album entry " + contextAlbumEntry.getKey()
+ + " may not be the null key"));
} else if (contextAlbumEntry.getValue() == null) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "value on context album entry " + contextAlbumEntry.getKey() + " may not be null"));
+ "value on context album entry " + contextAlbumEntry.getKey() + " may not be null"));
} else {
validateContextAlbumKey(result, contextAlbumEntry);
@@ -274,19 +273,19 @@ public final class AxContextAlbums extends AxConcept implements AxConceptGetter<
}
private void validateContextAlbumKey(final AxValidationResult result,
- final Entry<AxArtifactKey, AxContextAlbum> contextAlbumEntry) {
+ final Entry<AxArtifactKey, AxContextAlbum> contextAlbumEntry) {
if (!contextAlbumEntry.getKey().equals(contextAlbumEntry.getValue().getKey())) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "key on context album entry key " + contextAlbumEntry.getKey()
- + " does not equal context album value key " + contextAlbumEntry.getValue().getKey()));
+ "key on context album entry key " + contextAlbumEntry.getKey()
+ + " does not equal context album value key "
+ + contextAlbumEntry.getValue().getKey()));
}
}
/*
* (non-Javadoc)
*
- * @see
- * org.onap.policy.apex.model.basicmodel.concepts.AxConcept#copyTo(org.onap.policy.apex.model.
+ * @see org.onap.policy.apex.model.basicmodel.concepts.AxConcept#copyTo(org.onap.policy.apex.model.
* basicmodel.concepts.AxConcept)
*/
@Override
@@ -301,7 +300,7 @@ public final class AxContextAlbums extends AxConcept implements AxConceptGetter<
final Map<AxArtifactKey, AxContextAlbum> newContextAlbum = new TreeMap<>();
for (final Entry<AxArtifactKey, AxContextAlbum> contextAlbumEntry : albums.entrySet()) {
newContextAlbum.put(new AxArtifactKey(contextAlbumEntry.getKey()),
- new AxContextAlbum(contextAlbumEntry.getValue()));
+ new AxContextAlbum(contextAlbumEntry.getValue()));
}
copy.setAlbumsMap(newContextAlbum);
@@ -399,13 +398,12 @@ public final class AxContextAlbums extends AxConcept implements AxConceptGetter<
/*
* (non-Javadoc)
*
- * @see org.onap.policy.apex.model.basicmodel.concepts.AxConceptGetter#get(java.lang.String,
- * java.lang.String)
+ * @see org.onap.policy.apex.model.basicmodel.concepts.AxConceptGetter#get(java.lang.String, java.lang.String)
*/
@Override
public AxContextAlbum get(final String conceptKeyName, final String conceptKeyVersion) {
return new AxConceptGetterImpl<>((NavigableMap<AxArtifactKey, AxContextAlbum>) albums).get(conceptKeyName,
- conceptKeyVersion);
+ conceptKeyVersion);
}
/*
@@ -421,12 +419,11 @@ public final class AxContextAlbums extends AxConcept implements AxConceptGetter<
/*
* (non-Javadoc)
*
- * @see org.onap.policy.apex.model.basicmodel.concepts.AxConceptGetter#getAll(java.lang.String,
- * java.lang.String)
+ * @see org.onap.policy.apex.model.basicmodel.concepts.AxConceptGetter#getAll(java.lang.String, java.lang.String)
*/
@Override
public Set<AxContextAlbum> getAll(final String conceptKeyName, final String conceptKeyVersion) {
return new AxConceptGetterImpl<>((NavigableMap<AxArtifactKey, AxContextAlbum>) albums).getAll(conceptKeyName,
- conceptKeyVersion);
+ conceptKeyVersion);
}
}
diff --git a/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextModel.java b/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextModel.java
index 2aa6fc70a..56983f37b 100644
--- a/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextModel.java
+++ b/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextModel.java
@@ -48,8 +48,8 @@ import org.onap.policy.apex.model.utilities.Assertions;
* constructed that just contains context and the key information for that context. The model contains schema
* definitions and the definitions of context albums that use those schemas. In the case where Apex context is being
* used without policy or independent of policy, an Apex context model is sufficient to get Apex context working.
- * <p>
- * Validation runs {@link AxModel} validation on the model. In addition, the {@link AxContextSchemas} and
+ *
+ * <p>Validation runs {@link AxModel} validation on the model. In addition, the {@link AxContextSchemas} and
* {@link AxContextAlbums} validation is run on the context schemas and albums in the model.
*/
@Entity
@@ -102,7 +102,7 @@ public class AxContextModel extends AxModel {
}
/**
- * Copy constructor
+ * Copy constructor.
*
* @param copyConcept the concept to copy from
*/
diff --git a/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextSchema.java b/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextSchema.java
index 87c89376e..5dad2e9e8 100644
--- a/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextSchema.java
+++ b/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextSchema.java
@@ -50,24 +50,24 @@ import org.onap.policy.apex.model.utilities.Assertions;
* schema flavour defines the type of schema being defined and the schema itself defines the schema. The schema flavour
* is used by Apex to look up and load a plugin class that understands and interprets the schema definition and can
* create instances of classes for the schema.
- * <p>
- * An {@link AxContextSchema} is used to define each parameter in Apex events, the messages that enter, exit, and are
+ *
+ * <p>An {@link AxContextSchema} is used to define each parameter in Apex events, the messages that enter, exit, and are
* passed internally in Apex. In addition, an Apex {@link AxContextAlbum} instances hold a map of
* {@link AxContextSchema} instances to represent the context being managed as an {@link AxContextAlbum}. For example,
* the state of all cells in a mobile network might be represented as an {@link AxContextAlbum} with its
* {@link AxContextSchema} being defined as @code cell} objects.
- * <p>
- * Validation checks that the schema key is not null. It also checks that the schema flavour is defined and matches the
- * regular expression SCHEMA_FLAVOUR_REGEXP. Finally, validation checks that the defined schema is not a blank
- * or empty string.
+ *
+ * <p>Validation checks that the schema key is not null. It also checks that the schema flavour is defined and matches
+ * the regular expression SCHEMA_FLAVOUR_REGEXP. Finally, validation checks that the defined schema is not a blank or
+ * empty string.
*/
@Entity
@Table(name = "AxContextSchema")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "apexContextSchema", namespace = "http://www.onap.org/policy/apex-pdp")
-@XmlType(name = "AxContextSchema", namespace = "http://www.onap.org/policy/apex-pdp",
- propOrder = { "key", "schemaFlavour", "schemaDefinition" })
+@XmlType(name = "AxContextSchema", namespace = "http://www.onap.org/policy/apex-pdp", propOrder =
+ { "key", "schemaFlavour", "schemaDefinition" })
public class AxContextSchema extends AxConcept {
private static final String SCHEMA_FLAVOUR = "schemaFlavour";
@@ -108,7 +108,7 @@ public class AxContextSchema extends AxConcept {
}
/**
- * Copy constructor
+ * Copy constructor.
*
* @param copyConcept the concept to copy from
*/
@@ -222,28 +222,28 @@ public class AxContextSchema extends AxConcept {
AxValidationResult result = resultIn;
if (key.equals(AxArtifactKey.getNullKey())) {
- result.addValidationMessage(
- new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID, "key is a null key"));
+ result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
+ "key is a null key"));
}
result = key.validate(result);
if (schemaFlavour.replaceAll(WHITESPACE_REGEXP, "").length() == 0
- || schemaFlavour.equals(SCHEMA_FLAVOUR_UNDEFINED)) {
+ || schemaFlavour.equals(SCHEMA_FLAVOUR_UNDEFINED)) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "schema flavour is not defined"));
+ "schema flavour is not defined"));
}
try {
Assertions.validateStringParameter(SCHEMA_FLAVOUR, schemaFlavour, SCHEMA_FLAVOUR_REGEXP);
} catch (final IllegalArgumentException e) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "schema flavour invalid-" + e.getMessage()));
+ "schema flavour invalid-" + e.getMessage()));
}
if (schemaDefinition.replaceAll(WHITESPACE_REGEXP, "").length() == 0) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "no schemaDefinition specified, schemaDefinition may not be blank"));
+ "no schemaDefinition specified, schemaDefinition may not be blank"));
}
return result;
diff --git a/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextSchemas.java b/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextSchemas.java
index df94a87a9..2b31aa425 100644
--- a/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextSchemas.java
+++ b/model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextSchemas.java
@@ -55,8 +55,8 @@ import org.onap.policy.apex.model.utilities.Assertions;
* models that use context schemas must have an {@link AxContextSchemas} field. The {@link AxContextSchemas} class
* implements the helper methods of the {@link AxConceptGetter} interface to allow {@link AxContextSchema} instances to
* be retrieved by calling methods directly on this class without referencing the contained map.
- * <p>
- * Validation checks that the container key is not null. An error is issued if no context schemas are defined in the
+ *
+ * <p>Validation checks that the container key is not null. An error is issued if no context schemas are defined in the
* container. Each context schema entry is checked to ensure that its key and value are not null and that the key
* matches the key in the map value. Each context schema entry is then validated individually.
*/
@@ -64,7 +64,8 @@ import org.onap.policy.apex.model.utilities.Assertions;
@Table(name = "AxContextSchemas")
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "AxContextSchemas", namespace = "http://www.onap.org/policy/apex-pdp", propOrder = { "key", "schemas" })
+@XmlType(name = "AxContextSchemas", namespace = "http://www.onap.org/policy/apex-pdp", propOrder =
+ { "key", "schemas" })
public class AxContextSchemas extends AxConcept implements AxConceptGetter<AxContextSchema> {
private static final long serialVersionUID = -3203734282886453582L;
@@ -93,7 +94,7 @@ public class AxContextSchemas extends AxConcept implements AxConceptGetter<AxCon
}
/**
- * Copy constructor
+ * Copy constructor.
*
* @param copyConcept the concept to copy from
*/
@@ -132,10 +133,10 @@ public class AxContextSchemas extends AxConcept implements AxConceptGetter<AxCon
* map. This method is called by JAXB after unmarshaling and is used to convert the hash map to a
* {@link NavigableMap} so that it will work with the {@link AxConceptGetter} interface.
*
- * @param u the unmarshaler that is unmarshaling the model
+ * @param unmarshaller the unmarshaler that is unmarshaling the model
* @param parent the parent object of this object in the unmarshaler
*/
- public void afterUnmarshal(final Unmarshaller u, final Object parent) {
+ public void afterUnmarshal(final Unmarshaller unmarshaller, final Object parent) {
// The map must be navigable to allow name and version searching, unmarshaling returns a
// hash map
final NavigableMap<AxArtifactKey, AxContextSchema> navigableContextSchemas = new TreeMap<>();
@@ -208,28 +209,31 @@ public class AxContextSchemas extends AxConcept implements AxConceptGetter<AxCon
AxValidationResult result = resultIn;
if (key.equals(AxArtifactKey.getNullKey())) {
- result.addValidationMessage(
- new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID, "key is a null key"));
+ result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
+ "key is a null key"));
}
result = key.validate(result);
if (schemas.size() == 0) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "contextSchemas may not be empty"));
+ "contextSchemas may not be empty"));
} else {
for (final Entry<AxArtifactKey, AxContextSchema> contextSchemaEntry : schemas.entrySet()) {
if (contextSchemaEntry.getKey().equals(AxArtifactKey.getNullKey())) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "key on schemas entry " + contextSchemaEntry.getKey() + " may not be the null key"));
+ "key on schemas entry " + contextSchemaEntry.getKey()
+ + " may not be the null key"));
} else if (contextSchemaEntry.getValue() == null) {
result.addValidationMessage(new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
- "value on schemas entry " + contextSchemaEntry.getKey() + " may not be null"));
+ "value on schemas entry " + contextSchemaEntry.getKey() + " may not be null"));
} else {
if (!contextSchemaEntry.getKey().equals(contextSchemaEntry.getValue().getKey())) {
- result.addValidationMessage(new AxValidationMessage(key, this.getClass(),
- ValidationResult.INVALID, "key on schemas entry " + contextSchemaEntry.getKey()
- + " does not equal entry key " + contextSchemaEntry.getValue().getKey()));
+ result.addValidationMessage(
+ new AxValidationMessage(key, this.getClass(), ValidationResult.INVALID,
+ "key on schemas entry " + contextSchemaEntry.getKey()
+ + " does not equal entry key "
+ + contextSchemaEntry.getValue().getKey()));
}
result = contextSchemaEntry.getValue().validate(result);
@@ -291,7 +295,7 @@ public class AxContextSchemas extends AxConcept implements AxConceptGetter<AxCon
final Map<AxArtifactKey, AxContextSchema> newcontextSchemas = new TreeMap<>();
for (final Entry<AxArtifactKey, AxContextSchema> contextSchemasEntry : schemas.entrySet()) {
newcontextSchemas.put(new AxArtifactKey(contextSchemasEntry.getKey()),
- new AxContextSchema(contextSchemasEntry.getValue()));
+ new AxContextSchema(contextSchemasEntry.getValue()));
}
copy.setSchemasMap(newcontextSchemas);
@@ -393,7 +397,7 @@ public class AxContextSchemas extends AxConcept implements AxConceptGetter<AxCon
@Override
public AxContextSchema get(final String conceptKeyName, final String conceptKeyVersion) {
return new AxConceptGetterImpl<>((NavigableMap<AxArtifactKey, AxContextSchema>) schemas).get(conceptKeyName,
- conceptKeyVersion);
+ conceptKeyVersion);
}
/*
@@ -414,6 +418,6 @@ public class AxContextSchemas extends AxConcept implements AxConceptGetter<AxCon
@Override
public Set<AxContextSchema> getAll(final String conceptKeyName, final String conceptKeyVersion) {
return new AxConceptGetterImpl<>((NavigableMap<AxArtifactKey, AxContextSchema>) schemas).getAll(conceptKeyName,
- conceptKeyVersion);
+ conceptKeyVersion);
}
}