Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
Signed-off-by: Attila Mészáros <csviri@gmail.com>
  • Loading branch information
csviri committed May 2, 2024
1 parent af2f2b0 commit 11b1d05
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package io.csviri.operator.glue.customresource.operator;

import java.util.Objects;

public class GlueMetadata {

String name;
String namespace;

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getNamespace() {
return namespace;
}

public void setNamespace(String namespace) {
this.namespace = namespace;
}

@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
GlueMetadata that = (GlueMetadata) o;
return Objects.equals(name, that.name) && Objects.equals(namespace, that.namespace);
}

@Override
public int hashCode() {
return Objects.hash(name, namespace);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public class GlueOperatorSpec extends GlueSpec {
@Required
private Parent parent;

private GlueMetadata glueMetadata;

public Parent getParent() {
return parent;
}
Expand All @@ -19,6 +21,14 @@ public GlueOperatorSpec setParent(Parent parent) {
return this;
}

public GlueMetadata getGlueMetadata() {
return glueMetadata;
}

public void setGlueMetadata(GlueMetadata glueMetadata) {
this.glueMetadata = glueMetadata;
}

@Override
public boolean equals(Object o) {
if (this == o)
Expand All @@ -28,12 +38,11 @@ public boolean equals(Object o) {
if (!super.equals(o))
return false;
GlueOperatorSpec that = (GlueOperatorSpec) o;
return Objects.equals(parent, that.parent);
return Objects.equals(parent, that.parent) && Objects.equals(glueMetadata, that.glueMetadata);
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), parent);
return Objects.hash(super.hashCode(), parent, glueMetadata);
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.csviri.operator.glue.customresource.operator;

import java.util.Objects;

public class Parent {

private String apiVersion;
Expand Down Expand Up @@ -38,4 +40,20 @@ public String getLabelSelector() {
public void setLabelSelector(String labelSelector) {
this.labelSelector = labelSelector;
}

@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
Parent parent = (Parent) o;
return Objects.equals(apiVersion, parent.apiVersion) && Objects.equals(kind, parent.kind)
&& Objects.equals(labelSelector, parent.labelSelector);
}

@Override
public int hashCode() {
return Objects.hash(apiVersion, kind, labelSelector);
}
}

0 comments on commit 11b1d05

Please sign in to comment.