Skip to content

Commit

Permalink
style fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ilicmarkodb committed Sep 24, 2024
1 parent 0eed49e commit 480532f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@
*/
package io.delta.kernel.types;

import io.delta.kernel.annotation.Evolving;
import static io.delta.kernel.internal.util.Preconditions.checkArgument;

import io.delta.kernel.annotation.Evolving;
import java.util.Objects;
import java.util.Optional;

import static io.delta.kernel.internal.util.Preconditions.checkArgument;

/**
* Identifies collation for string type.
* <a href="https://github.com/delta-io/delta/blob/master/protocol_rfcs/collated-string-type.md#collation-identifiers">
* Collation identifiers</a>
* Identifies collation for string type. <a
* href="https://github.com/delta-io/delta/blob/master/protocol_rfcs/collated-string-type.md#collation-identifiers">
* Collation identifiers</a>
*
* @since 3.3.0
*/
Expand All @@ -50,33 +49,24 @@ private CollationIdentifier(String provider, String collationName, Optional<Stri
this.version = version.map(String::toUpperCase);
}

/**
*
* @return collation provider.
*/
/** @return collation provider. */
public String getProvider() {
return provider;
}

/**
*
* @return collation name.
*/
/** @return collation name. */
public String getName() {
return name;
}

/**
*
* @return provider version.
*/
/** @return provider version. */
public Optional<String> getVersion() {
return version;
}

/**
*
* @param identifier collation identifier in string form of <br>{@code PROVIDER.COLLATION_NAME[.PROVIDER_VERSION]}.
* @param identifier collation identifier in string form of <br>
* {@code PROVIDER.COLLATION_NAME[.PROVIDER_VERSION]}.
* @return appropriate collation identifier object
*/
public static CollationIdentifier fromString(String identifier) {
Expand All @@ -91,9 +81,7 @@ public static CollationIdentifier fromString(String identifier) {
}
}

/**
* Collation identifiers are identical when the provider, name, and version are the same.
*/
/** Collation identifiers are identical when the provider, name, and version are the same. */
@Override
public boolean equals(Object o) {
if (!(o instanceof CollationIdentifier)) {
Expand All @@ -102,22 +90,16 @@ public boolean equals(Object o) {

CollationIdentifier other = (CollationIdentifier) o;
return this.provider.equals(other.provider)
&& this.name.equals(other.name)
&& this.version.equals(other.version);
&& this.name.equals(other.name)
&& this.version.equals(other.version);
}

/**
*
* @return collation identifier in form of {@code PROVIDER.COLLATION_NAME}.
*/
/** @return collation identifier in form of {@code PROVIDER.COLLATION_NAME}. */
public String toStringWithoutVersion() {
return String.format("%s.%s", provider, name);
}

/**
*
* @return collation identifier in form of {@code PROVIDER.COLLATION_NAME[.PROVIDER_VERSION]}
*/
/** @return collation identifier in form of {@code PROVIDER.COLLATION_NAME[.PROVIDER_VERSION]} */
@Override
public String toString() {
if (version.isPresent()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,29 +30,25 @@ public class StringType extends BasePrimitiveType {
private final CollationIdentifier collationIdentifier;

/**
*
* @param collationIdentifier An identifier representing the collation to be used for string comparison and sorting.
* This determines how strings will be ordered and compared in query operations.
* @param collationIdentifier An identifier representing the collation to be used for string
* comparison and sorting. This determines how strings will be ordered and compared in query
* operations.
*/
public StringType(CollationIdentifier collationIdentifier) {
super("string");
this.collationIdentifier = collationIdentifier;
}

/**
*
* @param collationName name of collation in which this StringType will be observed.
* In form of {@code PROVIDER.COLLATION_NAME[.VERSION]}
* @param collationName name of collation in which this StringType will be observed. In form of
* {@code PROVIDER.COLLATION_NAME[.VERSION]}
*/
public StringType(String collationName) {
super("string");
this.collationIdentifier = CollationIdentifier.fromString(collationName);
}

/**
*
* @return StringType's collation identifier
*/
/** @return StringType's collation identifier */
public CollationIdentifier getCollationIdentifier() {
return collationIdentifier;
}
Expand Down

0 comments on commit 480532f

Please sign in to comment.