private void compareStandardTableDefinition( StandardTableDefinition expected, StandardTableDefinition value) { assertEquals(expected, value); assertEquals(expected.getSchema(), value.getSchema()); assertEquals(expected.getType(), value.getType()); assertEquals(expected.getNumBytes(), value.getNumBytes()); assertEquals(expected.getNumRows(), value.getNumRows()); assertEquals(expected.getLocation(), value.getLocation()); assertEquals(expected.getStreamingBuffer(), value.getStreamingBuffer()); assertEquals(expected.getType(), value.getType()); assertEquals(expected.getTimePartitioning(), value.getTimePartitioning()); assertEquals(expected.getClustering(), value.getClustering()); assertEquals(expected.hashCode(), value.hashCode()); } }
@Test public void testBuilder() { assertEquals(TableDefinition.Type.TABLE, TABLE_DEFINITION.getType()); assertEquals(TABLE_SCHEMA, TABLE_DEFINITION.getSchema()); assertEquals(LOCATION, TABLE_DEFINITION.getLocation()); assertEquals(NUM_BYTES, TABLE_DEFINITION.getNumBytes()); assertEquals(NUM_ROWS, TABLE_DEFINITION.getNumRows()); assertEquals(STREAMING_BUFFER, TABLE_DEFINITION.getStreamingBuffer()); assertEquals(TIME_PARTITIONING, TABLE_DEFINITION.getTimePartitioning()); assertEquals(CLUSTERING, TABLE_DEFINITION.getClustering()); }
@Test public void testOf() { StandardTableDefinition definition = StandardTableDefinition.of(TABLE_SCHEMA); assertEquals(TableDefinition.Type.TABLE, TABLE_DEFINITION.getType()); assertEquals(TABLE_SCHEMA, TABLE_DEFINITION.getSchema()); assertNull(definition.getLocation()); assertNull(definition.getNumBytes()); assertNull(definition.getNumRows()); assertNull(definition.getStreamingBuffer()); assertNull(definition.getTimePartitioning()); assertNull(definition.getClustering()); }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof StandardTableDefinition) { StandardTableDefinition that = (StandardTableDefinition) o; return (this.type.equals(that.getType())) && ((this.schema == null) ? (that.getSchema() == null) : this.schema.equals(that.getSchema())) && ((this.numBytes == null) ? (that.getNumBytes() == null) : this.numBytes.equals(that.getNumBytes())) && ((this.numRows == null) ? (that.getNumRows() == null) : this.numRows.equals(that.getNumRows())) && ((this.location == null) ? (that.getLocation() == null) : this.location.equals(that.getLocation())) && ((this.streamingBuffer == null) ? (that.getStreamingBuffer() == null) : this.streamingBuffer.equals(that.getStreamingBuffer())) && ((this.timePartitioning == null) ? (that.getTimePartitioning() == null) : this.timePartitioning.equals(that.getTimePartitioning())) && ((this.clustering == null) ? (that.getClustering() == null) : this.clustering.equals(that.getClustering())); } return false; }
private Builder(StandardTableDefinition source) { this.type = source.getType(); this.schema = source.getSchema(); this.numBytes = source.getNumBytes(); this.numRows = source.getNumRows(); this.location = source.getLocation(); this.streamingBuffer = source.getStreamingBuffer(); this.timePartitioning = source.getTimePartitioning(); this.clustering = source.getClustering(); } @Override