Skip to content

Commit

Permalink
Revert "Set headerVersion"
Browse files Browse the repository at this point in the history
This reverts commit 7f46032.

Signed-off-by: Nigel Jones <[email protected]>
  • Loading branch information
planetf1 committed Dec 20, 2022
1 parent 31bac9c commit b16dd08
Show file tree
Hide file tree
Showing 22 changed files with 136 additions and 422 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,6 @@ else if (propertyValue instanceof StructTypePropertyValue)
org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.ArrayPropertyValue
omrsPropertyValue = new org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.ArrayPropertyValue();

omrsPropertyValue.setHeaderVersion(InstancePropertyValue.CURRENT_INSTANCE_PROPERTY_VALUE_HEADER_VERSION);
omrsPropertyValue.setInstancePropertyCategory(InstancePropertyCategory.ARRAY);
omrsPropertyValue.setTypeGUID(typeDef.getGUID());
omrsPropertyValue.setTypeName(typeDef.getName());
Expand Down Expand Up @@ -753,7 +752,6 @@ else if (propertyValue instanceof StructTypePropertyValue)
omrsPropertyValue =
new org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EnumPropertyValue();

omrsPropertyValue.setHeaderVersion(InstancePropertyValue.CURRENT_INSTANCE_PROPERTY_VALUE_HEADER_VERSION);
omrsPropertyValue.setInstancePropertyCategory(InstancePropertyCategory.ENUM);
omrsPropertyValue.setTypeGUID(typeDef.getGUID());
omrsPropertyValue.setTypeName(typeDef.getName());
Expand Down Expand Up @@ -787,7 +785,6 @@ else if (propertyValue instanceof StructTypePropertyValue)
org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.MapPropertyValue
omrsPropertyValue = new org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.MapPropertyValue();

omrsPropertyValue.setHeaderVersion(InstancePropertyValue.CURRENT_INSTANCE_PROPERTY_VALUE_HEADER_VERSION);
omrsPropertyValue.setInstancePropertyCategory(InstancePropertyCategory.MAP);
omrsPropertyValue.setTypeGUID(typeDef.getGUID());
omrsPropertyValue.setTypeName(typeDef.getName());
Expand Down Expand Up @@ -831,7 +828,6 @@ else if (propertyValue instanceof StructTypePropertyValue)
org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.PrimitivePropertyValue
omrsPropertyValue = new org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.PrimitivePropertyValue();

omrsPropertyValue.setHeaderVersion(InstancePropertyValue.CURRENT_INSTANCE_PROPERTY_VALUE_HEADER_VERSION);
omrsPropertyValue.setInstancePropertyCategory(InstancePropertyCategory.PRIMITIVE);
omrsPropertyValue.setTypeGUID(typeDef.getGUID());
omrsPropertyValue.setTypeName(typeDef.getName());
Expand Down Expand Up @@ -918,7 +914,6 @@ else if (propertyValue instanceof StructTypePropertyValue)
org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.StructPropertyValue
omrsPropertyValue = new org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.StructPropertyValue();

omrsPropertyValue.setHeaderVersion(InstancePropertyValue.CURRENT_INSTANCE_PROPERTY_VALUE_HEADER_VERSION);
omrsPropertyValue.setInstancePropertyCategory(InstancePropertyCategory.STRUCT);
omrsPropertyValue.setTypeGUID(typeDef.getGUID());
omrsPropertyValue.setTypeName(typeDef.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,6 @@ public ClassificationEntityExtension getClassification(String entityGUID,

dummyClassification.setName(classificationName);
dummyEntity.setGUID(entityGUID);
dummyExtension.setHeaderVersion(ClassificationEntityExtension.CURRENT_CLASSIFICATION_EXT_HEADER_VERSION);
dummyExtension.setClassification(dummyClassification);
dummyExtension.setEntityToClassify(dummyEntity);

Expand Down Expand Up @@ -851,7 +850,6 @@ public ClassificationEntityExtension queryClassification(String entityGUID,

dummyClassification.setName(classificationName);
dummyEntity.setGUID(entityGUID);
dummyExtension.setHeaderVersion(ClassificationEntityExtension.CURRENT_CLASSIFICATION_EXT_HEADER_VERSION);
dummyExtension.setClassification(dummyClassification);
dummyExtension.setEntityToClassify(dummyEntity);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,6 @@ else if (propertyValue instanceof StructTypePropertyValue)
org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.ArrayPropertyValue
omrsPropertyValue = new org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.ArrayPropertyValue();

omrsPropertyValue.setHeaderVersion(InstancePropertyValue.CURRENT_INSTANCE_PROPERTY_VALUE_HEADER_VERSION);
omrsPropertyValue.setInstancePropertyCategory(InstancePropertyCategory.ARRAY);
omrsPropertyValue.setTypeGUID(typeDef.getGUID());
omrsPropertyValue.setTypeName(typeDef.getName());
Expand Down Expand Up @@ -766,7 +765,6 @@ else if (propertyValue instanceof StructTypePropertyValue)
omrsPropertyValue =
new org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EnumPropertyValue();

omrsPropertyValue.setHeaderVersion(InstancePropertyValue.CURRENT_INSTANCE_PROPERTY_VALUE_HEADER_VERSION);
omrsPropertyValue.setInstancePropertyCategory(InstancePropertyCategory.ENUM);
omrsPropertyValue.setTypeGUID(typeDef.getGUID());
omrsPropertyValue.setTypeName(typeDef.getName());
Expand Down Expand Up @@ -800,7 +798,6 @@ else if (propertyValue instanceof StructTypePropertyValue)
org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.MapPropertyValue
omrsPropertyValue = new org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.MapPropertyValue();

omrsPropertyValue.setHeaderVersion(InstancePropertyValue.CURRENT_INSTANCE_PROPERTY_VALUE_HEADER_VERSION);
omrsPropertyValue.setInstancePropertyCategory(InstancePropertyCategory.MAP);
omrsPropertyValue.setTypeGUID(typeDef.getGUID());
omrsPropertyValue.setTypeName(typeDef.getName());
Expand Down Expand Up @@ -844,7 +841,6 @@ else if (propertyValue instanceof StructTypePropertyValue)
org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.PrimitivePropertyValue
omrsPropertyValue = new org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.PrimitivePropertyValue();

omrsPropertyValue.setHeaderVersion(InstancePropertyValue.CURRENT_INSTANCE_PROPERTY_VALUE_HEADER_VERSION);
omrsPropertyValue.setInstancePropertyCategory(InstancePropertyCategory.PRIMITIVE);
omrsPropertyValue.setTypeGUID(typeDef.getGUID());
omrsPropertyValue.setTypeName(typeDef.getName());
Expand Down Expand Up @@ -931,7 +927,6 @@ else if (propertyValue instanceof StructTypePropertyValue)
org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.StructPropertyValue
omrsPropertyValue = new org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.StructPropertyValue();

omrsPropertyValue.setHeaderVersion(InstancePropertyValue.CURRENT_INSTANCE_PROPERTY_VALUE_HEADER_VERSION);
omrsPropertyValue.setInstancePropertyCategory(InstancePropertyCategory.STRUCT);
omrsPropertyValue.setTypeGUID(typeDef.getGUID());
omrsPropertyValue.setTypeName(typeDef.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.ArrayPropertyValue;
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.ClassificationEntityExtension;
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceAuditHeader;
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceElementHeader;
Expand All @@ -17,7 +16,6 @@
import org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.typedefs.TypeDefElementHeader;

import java.io.Serializable;
import java.util.Objects;

import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY;
Expand Down Expand Up @@ -96,38 +94,4 @@ public void setHeaderVersion(long headerVersion)
}


/**
* Validate that an object is equal depending on their stored values.
*
* @param objectToCompare object
* @return boolean result
*/
@Override
public boolean equals(Object objectToCompare)
{
if (this == objectToCompare)
{
return true;
}
if (! (objectToCompare instanceof RepositoryElementHeader))
{
return false;
}

RepositoryElementHeader that = (RepositoryElementHeader) objectToCompare;

return headerVersion == that.headerVersion;
}


/**
* Return a hash code based on the property values
*
* @return int hash code
*/
@Override
public int hashCode()
{
return (int) (headerVersion ^ (headerVersion >>> 32));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import org.odpi.openmetadata.repositoryservices.ffdc.OMRSErrorCode;
import org.odpi.openmetadata.repositoryservices.ffdc.exception.OMRSRuntimeException;

import java.util.Objects;

import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY;

Expand All @@ -30,8 +32,7 @@ public class ArrayPropertyValue extends InstancePropertyValue
/**
* Default constructor sets the array to empty.
*/
public ArrayPropertyValue()
{
public ArrayPropertyValue() {
super(InstancePropertyCategory.ARRAY);
}

Expand Down Expand Up @@ -167,8 +168,7 @@ public void setArrayValues(InstanceProperties arrayValues) {
* @return JSON style description of variables.
*/
@Override
public String toString()
{
public String toString() {
return "ArrayPropertyValue{" +
"arrayCount=" + arrayCount +
", arrayValues=" + arrayValues +
Expand All @@ -192,22 +192,13 @@ public boolean equals(Object objectToCompare)
{
return true;
}
if (! (objectToCompare instanceof ArrayPropertyValue))
{
return false;
}
if (! super.equals(objectToCompare))
if (objectToCompare == null || getClass() != objectToCompare.getClass())
{
return false;
}

ArrayPropertyValue that = (ArrayPropertyValue) objectToCompare;

if (arrayCount != that.arrayCount)
{
return false;
}
return arrayValues != null ? arrayValues.equals(that.arrayValues) : that.arrayValues == null;
return arrayCount == that.arrayCount &&
Objects.equals(arrayValues, that.arrayValues);
}


Expand All @@ -217,11 +208,7 @@ public boolean equals(Object objectToCompare)
* @return int hash code
*/
@Override
public int hashCode()
{
int result = super.hashCode();
result = 31 * result + arrayCount;
result = 31 * result + (arrayValues != null ? arrayValues.hashCode() : 0);
return result;
public int hashCode() {
return Objects.hash(arrayCount, arrayValues);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
package org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances;


import java.util.Objects;

/**
* ClassificationEntityExtension is used to represent a single classification for an entity.
* It includes the details of the classification and an entity proxy to define which entity
Expand All @@ -16,8 +18,6 @@ public class ClassificationEntityExtension extends InstanceElementHeader
private Classification classification = null;
private EntityProxy entityToClassify = null;

public static final long CURRENT_CLASSIFICATION_EXT_HEADER_VERSION = 1;


/**
* Default constructor
Expand Down Expand Up @@ -117,22 +117,13 @@ public boolean equals(Object objectToCompare)
{
return true;
}
if (! (objectToCompare instanceof ClassificationEntityExtension))
{
return false;
}
if (! super.equals(objectToCompare))
if (objectToCompare == null || getClass() != objectToCompare.getClass())
{
return false;
}

ClassificationEntityExtension that = (ClassificationEntityExtension) objectToCompare;

if (classification != null ? ! classification.equals(that.classification) : that.classification != null)
{
return false;
}
return entityToClassify != null ? entityToClassify.equals(that.entityToClassify) : that.entityToClassify == null;
return Objects.equals(getClassification(), that.getClassification()) &&
Objects.equals(getEntityToClassify(), that.getEntityToClassify());
}


Expand All @@ -144,9 +135,6 @@ public boolean equals(Object objectToCompare)
@Override
public int hashCode()
{
int result = super.hashCode();
result = 31 * result + (classification != null ? classification.hashCode() : 0);
result = 31 * result + (entityToClassify != null ? entityToClassify.hashCode() : 0);
return result;
return Objects.hash(getClassification(), getEntityToClassify());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ public boolean equals(Object objectToCompare)
@Override
public int hashCode()
{

return Objects.hash(super.hashCode(), getOrdinal(), getSymbolicName(), getDescription());
}
}
Expand Down
Loading

0 comments on commit b16dd08

Please sign in to comment.