[jOOQ/jOOQ#11729] Make all record constructors public

This commit is contained in:
Lukas Eder 2021-04-20 12:04:57 +02:00
parent e694f3de92
commit cc92eb905c
8 changed files with 9 additions and 9 deletions

View File

@ -701,7 +701,7 @@ public class DefaultRecordMapper<R extends Record, E> implements RecordMapper<R,
}
}
private static final /* record */ class ConstructorCall<E> implements Callable<E> { private final Constructor<? extends E> constructor; ConstructorCall(Constructor<? extends E> constructor) { this.constructor = constructor; } public Constructor<? extends E> constructor() { return constructor; } @Override public boolean equals(Object o) { if (!(o instanceof ConstructorCall)) return false; ConstructorCall other = (ConstructorCall) o; if (!java.util.Objects.equals(this.constructor, other.constructor)) return false; return true; } @Override public int hashCode() { return java.util.Objects.hash(this.constructor); } @Override public String toString() { return new StringBuilder("ConstructorCall[").append("constructor=").append(this.constructor).append("]").toString(); }
private static final /* record */ class ConstructorCall<E> implements Callable<E> { private final Constructor<? extends E> constructor; public ConstructorCall(Constructor<? extends E> constructor) { this.constructor = constructor; } public Constructor<? extends E> constructor() { return constructor; } @Override public boolean equals(Object o) { if (!(o instanceof ConstructorCall)) return false; ConstructorCall other = (ConstructorCall) o; if (!java.util.Objects.equals(this.constructor, other.constructor)) return false; return true; } @Override public int hashCode() { return java.util.Objects.hash(this.constructor); } @Override public String toString() { return new StringBuilder("ConstructorCall[").append("constructor=").append(this.constructor).append("]").toString(); }
@Override
public E call() throws Exception {
return constructor.newInstance();

View File

@ -718,7 +718,7 @@ final class Diff {
return result.iterator();
}
private static final /* record */ class DiffResult { private final List<Query> queries; private final Set<ForeignKey<?, ?>> droppedFks; DiffResult(List<Query> queries, Set<ForeignKey<?, ?>> droppedFks) { this.queries = queries; this.droppedFks = droppedFks; } public List<Query> queries() { return queries; } public Set<ForeignKey<?, ?>> droppedFks() { return droppedFks; } @Override public boolean equals(Object o) { if (!(o instanceof DiffResult)) return false; DiffResult other = (DiffResult) o; if (!java.util.Objects.equals(this.queries, other.queries)) return false; if (!java.util.Objects.equals(this.droppedFks, other.droppedFks)) return false; return true; } @Override public int hashCode() { return java.util.Objects.hash(this.queries, this.droppedFks); }
private static final /* record */ class DiffResult { private final List<Query> queries; private final Set<ForeignKey<?, ?>> droppedFks; public DiffResult(List<Query> queries, Set<ForeignKey<?, ?>> droppedFks) { this.queries = queries; this.droppedFks = droppedFks; } public List<Query> queries() { return queries; } public Set<ForeignKey<?, ?>> droppedFks() { return droppedFks; } @Override public boolean equals(Object o) { if (!(o instanceof DiffResult)) return false; DiffResult other = (DiffResult) o; if (!java.util.Objects.equals(this.queries, other.queries)) return false; if (!java.util.Objects.equals(this.droppedFks, other.droppedFks)) return false; return true; } @Override public int hashCode() { return java.util.Objects.hash(this.queries, this.droppedFks); }
DiffResult() {
this(new ArrayList<>(), new HashSet<>());
}

View File

@ -147,7 +147,7 @@ final class ExplainQuery {
return new ExplainImpl(rows, cost, result.format());
}
private static final /* record */ class ExplainImpl implements Explain { private final double rows; private final double cost; private final String plan; ExplainImpl(double rows, double cost, String plan) { this.rows = rows; this.cost = cost; this.plan = plan; } public double rows() { return rows; } public double cost() { return cost; } public String plan() { return plan; } @Override public boolean equals(Object o) { if (!(o instanceof ExplainImpl)) return false; ExplainImpl other = (ExplainImpl) o; if (!java.util.Objects.equals(this.rows, other.rows)) return false; if (!java.util.Objects.equals(this.cost, other.cost)) return false; if (!java.util.Objects.equals(this.plan, other.plan)) return false; return true; } @Override public int hashCode() { return java.util.Objects.hash(this.rows, this.cost, this.plan); }
private static final /* record */ class ExplainImpl implements Explain { private final double rows; private final double cost; private final String plan; public ExplainImpl(double rows, double cost, String plan) { this.rows = rows; this.cost = cost; this.plan = plan; } public double rows() { return rows; } public double cost() { return cost; } public String plan() { return plan; } @Override public boolean equals(Object o) { if (!(o instanceof ExplainImpl)) return false; ExplainImpl other = (ExplainImpl) o; if (!java.util.Objects.equals(this.rows, other.rows)) return false; if (!java.util.Objects.equals(this.cost, other.cost)) return false; if (!java.util.Objects.equals(this.plan, other.plan)) return false; return true; } @Override public int hashCode() { return java.util.Objects.hash(this.rows, this.cost, this.plan); }
@Override
public String toString() {

View File

@ -4103,7 +4103,7 @@ final class DefaultParseContext extends AbstractScope implements ParseContext {
return storageStep;
}
private static final /* record */ class ParseInlineConstraints { private final DataType<?> type; private final Comment fieldComment; private final boolean primary; private final boolean identity; ParseInlineConstraints(DataType<?> type, Comment fieldComment, boolean primary, boolean identity) { this.type = type; this.fieldComment = fieldComment; this.primary = primary; this.identity = identity; } public DataType<?> type() { return type; } public Comment fieldComment() { return fieldComment; } public boolean primary() { return primary; } public boolean identity() { return identity; } @Override public boolean equals(Object o) { if (!(o instanceof ParseInlineConstraints)) return false; ParseInlineConstraints other = (ParseInlineConstraints) o; if (!java.util.Objects.equals(this.type, other.type)) return false; if (!java.util.Objects.equals(this.fieldComment, other.fieldComment)) return false; if (!java.util.Objects.equals(this.primary, other.primary)) return false; if (!java.util.Objects.equals(this.identity, other.identity)) return false; return true; } @Override public int hashCode() { return java.util.Objects.hash(this.type, this.fieldComment, this.primary, this.identity); } @Override public String toString() { return new StringBuilder("ParseInlineConstraints[").append("type=").append(this.type).append(", fieldComment=").append(this.fieldComment).append(", primary=").append(this.primary).append(", identity=").append(this.identity).append("]").toString(); } }
private static final /* record */ class ParseInlineConstraints { private final DataType<?> type; private final Comment fieldComment; private final boolean primary; private final boolean identity; public ParseInlineConstraints(DataType<?> type, Comment fieldComment, boolean primary, boolean identity) { this.type = type; this.fieldComment = fieldComment; this.primary = primary; this.identity = identity; } public DataType<?> type() { return type; } public Comment fieldComment() { return fieldComment; } public boolean primary() { return primary; } public boolean identity() { return identity; } @Override public boolean equals(Object o) { if (!(o instanceof ParseInlineConstraints)) return false; ParseInlineConstraints other = (ParseInlineConstraints) o; if (!java.util.Objects.equals(this.type, other.type)) return false; if (!java.util.Objects.equals(this.fieldComment, other.fieldComment)) return false; if (!java.util.Objects.equals(this.primary, other.primary)) return false; if (!java.util.Objects.equals(this.identity, other.identity)) return false; return true; } @Override public int hashCode() { return java.util.Objects.hash(this.type, this.fieldComment, this.primary, this.identity); } @Override public String toString() { return new StringBuilder("ParseInlineConstraints[").append("type=").append(this.type).append(", fieldComment=").append(this.fieldComment).append(", primary=").append(this.primary).append(", identity=").append(this.identity).append("]").toString(); } }
private final ParseInlineConstraints parseInlineConstraints(
Name fieldName,

View File

@ -1052,7 +1052,7 @@ final class R2DBC {
return new MockArray<>(c.dialect(), (Object[]) nullable(columnIndex, Object.class), Object[].class);
}
private static final /* record */ class DefaultRow implements Row { private final Configuration c; private final Row r; DefaultRow(Configuration c, Row r) { this.c = c; this.r = r; } public Configuration c() { return c; } public Row r() { return r; } @Override public boolean equals(Object o) { if (!(o instanceof DefaultRow)) return false; DefaultRow other = (DefaultRow) o; if (!java.util.Objects.equals(this.c, other.c)) return false; if (!java.util.Objects.equals(this.r, other.r)) return false; return true; } @Override public int hashCode() { return java.util.Objects.hash(this.c, this.r); } @Override public String toString() { return new StringBuilder("DefaultRow[").append("c=").append(this.c).append(", r=").append(this.r).append("]").toString(); }
private static final /* record */ class DefaultRow implements Row { private final Configuration c; private final Row r; public DefaultRow(Configuration c, Row r) { this.c = c; this.r = r; } public Configuration c() { return c; } public Row r() { return r; } @Override public boolean equals(Object o) { if (!(o instanceof DefaultRow)) return false; DefaultRow other = (DefaultRow) o; if (!java.util.Objects.equals(this.c, other.c)) return false; if (!java.util.Objects.equals(this.r, other.r)) return false; return true; } @Override public int hashCode() { return java.util.Objects.hash(this.c, this.r); } @Override public String toString() { return new StringBuilder("DefaultRow[").append("c=").append(this.c).append(", r=").append(this.r).append("]").toString(); }
// These methods are proxied for some drivers that can't convert
// between data types. See:
@ -1097,7 +1097,7 @@ final class R2DBC {
}
}
static final /* record */ class R2DBCResultSetMetaData implements ResultSetMetaData { private final Configuration c; private final RowMetadata m; R2DBCResultSetMetaData(Configuration c, RowMetadata m) { this.c = c; this.m = m; } public Configuration c() { return c; } public RowMetadata m() { return m; } @Override public boolean equals(Object o) { if (!(o instanceof R2DBCResultSetMetaData)) return false; R2DBCResultSetMetaData other = (R2DBCResultSetMetaData) o; if (!java.util.Objects.equals(this.c, other.c)) return false; if (!java.util.Objects.equals(this.m, other.m)) return false; return true; } @Override public int hashCode() { return java.util.Objects.hash(this.c, this.m); } @Override public String toString() { return new StringBuilder("R2DBCResultSetMetaData[").append("c=").append(this.c).append(", m=").append(this.m).append("]").toString(); }
static final /* record */ class R2DBCResultSetMetaData implements ResultSetMetaData { private final Configuration c; private final RowMetadata m; public R2DBCResultSetMetaData(Configuration c, RowMetadata m) { this.c = c; this.m = m; } public Configuration c() { return c; } public RowMetadata m() { return m; } @Override public boolean equals(Object o) { if (!(o instanceof R2DBCResultSetMetaData)) return false; R2DBCResultSetMetaData other = (R2DBCResultSetMetaData) o; if (!java.util.Objects.equals(this.c, other.c)) return false; if (!java.util.Objects.equals(this.m, other.m)) return false; return true; } @Override public int hashCode() { return java.util.Objects.hash(this.c, this.m); } @Override public String toString() { return new StringBuilder("R2DBCResultSetMetaData[").append("c=").append(this.c).append(", m=").append(this.m).append("]").toString(); }
private final ColumnMetadata meta(int column) {
return m.getColumnMetadata(column - 1);

View File

@ -193,7 +193,7 @@ final class ResultsImpl extends AbstractList<Result<Record>> implements Results
return translated;
}
static final /* record */ class ResultOrRowsImpl implements ResultOrRows { private final Result<Record> result; private final int rows; private final DataAccessException exception; ResultOrRowsImpl(Result<Record> result, int rows, DataAccessException exception) { this.result = result; this.rows = rows; this.exception = exception; } public Result<Record> result() { return result; } public int rows() { return rows; } public DataAccessException exception() { return exception; } @Override public boolean equals(Object o) { if (!(o instanceof ResultOrRowsImpl)) return false; ResultOrRowsImpl other = (ResultOrRowsImpl) o; if (!java.util.Objects.equals(this.result, other.result)) return false; if (!java.util.Objects.equals(this.rows, other.rows)) return false; if (!java.util.Objects.equals(this.exception, other.exception)) return false; return true; } @Override public int hashCode() { return java.util.Objects.hash(this.result, this.rows, this.exception); }
static final /* record */ class ResultOrRowsImpl implements ResultOrRows { private final Result<Record> result; private final int rows; private final DataAccessException exception; public ResultOrRowsImpl(Result<Record> result, int rows, DataAccessException exception) { this.result = result; this.rows = rows; this.exception = exception; } public Result<Record> result() { return result; } public int rows() { return rows; } public DataAccessException exception() { return exception; } @Override public boolean equals(Object o) { if (!(o instanceof ResultOrRowsImpl)) return false; ResultOrRowsImpl other = (ResultOrRowsImpl) o; if (!java.util.Objects.equals(this.result, other.result)) return false; if (!java.util.Objects.equals(this.rows, other.rows)) return false; if (!java.util.Objects.equals(this.exception, other.exception)) return false; return true; } @Override public int hashCode() { return java.util.Objects.hash(this.result, this.rows, this.exception); }
ResultOrRowsImpl(Result<Record> result) {
this(result, result != null ? result.size() : 0, null);
}

View File

@ -110,7 +110,7 @@ final class ScopeStack<K, V> implements Iterable<V> {
return () -> new ScopeStackIterator<>(list -> list.get(list.size() - 1), filter);
}
static final /* record */ class Value<V> { private final int scopeLevel; private final V value; Value(int scopeLevel, V value) { this.scopeLevel = scopeLevel; this.value = value; } public int scopeLevel() { return scopeLevel; } public V value() { return value; } @Override public boolean equals(Object o) { if (!(o instanceof Value)) return false; Value other = (Value) o; if (!java.util.Objects.equals(this.scopeLevel, other.scopeLevel)) return false; if (!java.util.Objects.equals(this.value, other.value)) return false; return true; } @Override public int hashCode() { return java.util.Objects.hash(this.scopeLevel, this.value); } @Override public String toString() { return new StringBuilder("Value[").append("scopeLevel=").append(this.scopeLevel).append(", value=").append(this.value).append("]").toString(); }
static final /* record */ class Value<V> { private final int scopeLevel; private final V value; public Value(int scopeLevel, V value) { this.scopeLevel = scopeLevel; this.value = value; } public int scopeLevel() { return scopeLevel; } public V value() { return value; } @Override public boolean equals(Object o) { if (!(o instanceof Value)) return false; Value other = (Value) o; if (!java.util.Objects.equals(this.scopeLevel, other.scopeLevel)) return false; if (!java.util.Objects.equals(this.value, other.value)) return false; return true; } @Override public int hashCode() { return java.util.Objects.hash(this.scopeLevel, this.value); } @Override public String toString() { return new StringBuilder("Value[").append("scopeLevel=").append(this.scopeLevel).append(", value=").append(this.value).append("]").toString(); }
static <V> Value<V> of(int scopeLevel, V value) {
return value == null ? null : new Value<>(scopeLevel, value);
}

View File

@ -271,7 +271,7 @@ final class VersionImpl extends AbstractNode<Version> implements Version {
return "-- Version: " + id() + "\n" + meta();
}
private static final /* record */ class Parent { private final VersionImpl version; private final Queries queries; Parent(VersionImpl version, Queries queries) { this.version = version; this.queries = queries; } public VersionImpl version() { return version; } public Queries queries() { return queries; } @Override public boolean equals(Object o) { if (!(o instanceof Parent)) return false; Parent other = (Parent) o; if (!java.util.Objects.equals(this.version, other.version)) return false; if (!java.util.Objects.equals(this.queries, other.queries)) return false; return true; } @Override public int hashCode() { return java.util.Objects.hash(this.version, this.queries); }
private static final /* record */ class Parent { private final VersionImpl version; private final Queries queries; public Parent(VersionImpl version, Queries queries) { this.version = version; this.queries = queries; } public VersionImpl version() { return version; } public Queries queries() { return queries; } @Override public boolean equals(Object o) { if (!(o instanceof Parent)) return false; Parent other = (Parent) o; if (!java.util.Objects.equals(this.version, other.version)) return false; if (!java.util.Objects.equals(this.queries, other.queries)) return false; return true; } @Override public int hashCode() { return java.util.Objects.hash(this.version, this.queries); }
@Override
public String toString() {
return version.toString();