
org.hibernate.spatial.FunctionKey Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-spatial Show documentation
Show all versions of hibernate-spatial Show documentation
Integrate support for Spatial/GIS data into Hibernate O/RM
The newest version!
/*
* SPDX-License-Identifier: Apache-2.0
* Copyright Red Hat Inc. and Hibernate Authors
*/
package org.hibernate.spatial;
import java.util.Objects;
import java.util.Optional;
/**
* A the key vor a SpatialFunction
*/
public class FunctionKey {
final private String name;
final private String altName;
private FunctionKey(String name, String altName) {
this.name = name;
this.altName = altName;
}
public static FunctionKey apply(String name, String altName) {
return new FunctionKey( name, altName );
}
public static FunctionKey apply(String name) {
return new FunctionKey( name, null );
}
public String getName() {
return name;
}
public Optional getAltName() {
return Optional.ofNullable( altName );
}
@Override
public boolean equals(Object o) {
if ( this == o ) {
return true;
}
if ( o == null || getClass() != o.getClass() ) {
return false;
}
FunctionKey that = (FunctionKey) o;
return Objects.equals( name, that.name ) && Objects.equals( altName, that.altName );
}
@Override
public int hashCode() {
return Objects.hash( name, altName );
}
@Override
public String toString() {
return "SpatialFunctionKey{" + name + '}';
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy