Skip to content

Commit

Permalink
refact: default array query value
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <otaviopolianasantana@gmail.com>
  • Loading branch information
otaviojava committed Nov 11, 2023
1 parent 35a32d1 commit 13ae97d
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,41 @@

package org.eclipse.jnosql.communication.query;

import java.util.Arrays;

/**
* A sequence of elements that can be either {@link NumberQueryValue} or {@link StringQueryValue}
*/
record DefaultArrayQueryValue(QueryValue<?>[] values) implements ArrayQueryValue {



@Override
public QueryValue<?>[] get() {
return values;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof DefaultArrayQueryValue that)) {
return false;
}
return Arrays.equals(values, that.values);
}

@Override
public int hashCode() {
return Arrays.hashCode(values);
}

@Override
public String toString() {
return Arrays.toString(values);
}

static DefaultArrayQueryValue of(QueryValue<?>[] values) {
return new DefaultArrayQueryValue(values);
}
Expand Down

0 comments on commit 13ae97d

Please sign in to comment.