本文整理了Java中org.geotools.util.Version.equals()
方法的一些代码示例,展示了Version.equals()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Version.equals()
方法的具体详情如下:
包路径:org.geotools.util.Version
类名称:Version
方法名:equals
[英]Compare this version string with the specified object for equality. Two version are considered equal if #compareTo(Object)(other) == 0
.
[中]将此版本字符串与指定的对象进行比较,以确定是否相等。如果[$0$],则两个版本被视为相等。
代码示例来源:origin: geoserver/geoserver
@Override
public String mimeType(Version version) {
if (version != null && version.equals(VERSION_11)) {
return MIMETYPE_11;
}
return MIMETYPE_10;
}
代码示例来源:origin: geoserver/geoserver
public boolean equals(Object obj) {
if (!(obj instanceof Service)) {
return false;
}
Service other = (Service) obj;
if (!id.equals(other.id)) {
return false;
}
if (version == null) {
if (other.version != null) {
return false;
}
} else {
if (!version.equals(other.version)) {
return false;
}
}
return operations.equals(other.operations);
}
代码示例来源:origin: geoserver/geoserver
Service s = (Service) itr.next();
if (version.equals(s.getVersion())) {
continue;
代码示例来源:origin: geoserver/geoserver
XmlRequestReader r = (XmlRequestReader) itr.next();
if (r.getVersion() == null || version.equals(r.getVersion())) {
continue;
代码示例来源:origin: geoserver/geoserver
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (!(obj instanceof StyleInfo)) return false;
final StyleInfo other = (StyleInfo) obj;
if (filename == null) {
if (other.getFilename() != null) return false;
} else if (!filename.equals(other.getFilename())) return false;
if (id == null) {
if (other.getId() != null) return false;
} else if (!id.equals(other.getId())) return false;
if (name == null) {
if (other.getName() != null) return false;
} else if (!name.equals(other.getName())) return false;
if (workspace == null) {
if (other.getWorkspace() != null) return false;
} else if (!workspace.equals(other.getWorkspace())) return false;
if (format == null) {
if (other.getFormat() != null) return false;
} else {
if (!format.equals(other.getFormat())) return false;
}
if (languageVersion == null) {
if (other.getFormatVersion() != null) return false;
} else if (!languageVersion.equals(other.getFormatVersion())) return false;
return true;
}
代码示例来源:origin: geoserver/geoserver
Service service = (Service) s.next();
if (version.equals(service.getVersion())) {
found = true;
代码示例来源:origin: geotools/geotools
public static Version find(String capsVersion) {
if (capsVersion == null) {
throw new IllegalArgumentException();
}
Version v = new Version(capsVersion);
if (v1_0_0.equals(v)) {
return v1_0_0;
}
if (v1_1_0.equals(v)) {
return v1_1_0;
}
if (v2_0_0.equals(v)) {
return v2_0_0;
}
throw new IllegalArgumentException();
}
代码示例来源:origin: geotools/geotools
@Override
public Configuration getWfsConfiguration() {
return Versions.v1_0_0.equals(getServiceVersion())
? WFS_1_0_CONFIGURATION
: WFS_1_1_CONFIGURATION;
}
代码示例来源:origin: geotools/geotools
@Override
public Configuration getFilterConfiguration() {
return Versions.v1_0_0.equals(getServiceVersion())
? FILTER_1_0_CONFIGURATION
: FILTER_1_1_CONFIGURATION;
}
代码示例来源:origin: geotools/geotools
@Override
public boolean supports(ResultType resultType) {
switch (resultType) {
case RESULTS:
return true;
case HITS:
return Versions.v1_0_0.equals(getServiceVersion()) ? false : true;
default:
return false;
}
}
代码示例来源:origin: geotools/geotools
public boolean canSort() {
final Version capsVersion = new Version(capabilities.getVersion());
// currently on version 1.1.0 supports native sorting
if (Versions.v1_1_0.equals(capsVersion)) {
return true;
} else {
return false;
}
}
代码示例来源:origin: geotools/geotools
@Override
public List<String> getClientSupportedOutputFormats(WFSOperationType operation) {
List<WFSResponseFactory> operationResponseFactories;
operationResponseFactories = WFSExtensions.findResponseFactories(operation);
List<String> outputFormats = new LinkedList<String>();
for (WFSResponseFactory factory : operationResponseFactories) {
List<String> factoryFormats = factory.getSupportedOutputFormats();
outputFormats.addAll(factoryFormats);
}
final boolean wfs1_0 = Versions.v1_0_0.equals(serviceVersion);
if (GET_FEATURE.equals(operation)) {
for (String preferred :
wfs1_0 ? PREFFERRED_GETFEATURE_FORMATS_10 : PREFFERRED_GETFEATURE_FORMATS) {
boolean hasFormat = outputFormats.remove(preferred);
if (hasFormat) {
outputFormats.add(0, preferred);
break;
}
}
}
return outputFormats;
}
代码示例来源:origin: geotools/geotools
Configuration config(SldTransformContext context) {
if (context.version().equals(SldTransformContext.V_110)) {
return new org.geotools.filter.v1_1.OGCConfiguration();
} else {
return new org.geotools.filter.v1_0.OGCConfiguration();
}
}
}
代码示例来源:origin: geotools/geotools
@Override
public WFSServiceInfo getServiceInfo() {
final String schemaLocation;
if (Versions.v1_1_0.equals(getServiceVersion())) {
schemaLocation = "http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd";
} else {
schemaLocation = "http://schemas.opengis.net/wfs/1.1.0/wfs.xsd";
}
URL getCapsUrl = getOperationURL(GET_CAPABILITIES, GET);
return new CapabilitiesServiceInfo(schemaLocation, getCapsUrl, capabilities);
}
代码示例来源:origin: geotools/geotools
@Override
public Set<String> getSupportedCRSIdentifiers(QName typeName) {
FeatureTypeInfo featureTypeInfo = getFeatureTypeInfo(typeName);
String defaultSRS = featureTypeInfo.getDefaultSRS();
List<String> otherSRS = featureTypeInfo.getOtherSRS();
Set<String> ftypeCrss = new HashSet<String>();
ftypeCrss.add(defaultSRS);
ftypeCrss.addAll(otherSRS);
final boolean wfs2_0 = Versions.v2_0_0.equals(getServiceVersion());
if (wfs2_0) {
OperationType operationMetadata = getOperationMetadata(GET_FEATURE);
final String operationParameter = "SrsName";
Set<String> globalSrsNames = findParameters(operationMetadata, operationParameter);
ftypeCrss.addAll(globalSrsNames);
}
return ftypeCrss;
}
代码示例来源:origin: geotools/geotools
final boolean wfs1_0 = Versions.v1_0_0.equals(serviceVersion);
switch (operation) {
case GET_FEATURE:
代码示例来源:origin: geotools/geotools
/** @see WFSStrategy#getSupportedCRSIdentifiers */
@Override
public Set<String> getSupportedCRSIdentifiers(QName typeName) {
FeatureTypeInfo featureTypeInfo = getFeatureTypeInfo(typeName);
String defaultSRS = featureTypeInfo.getDefaultSRS();
List<String> otherSRS = featureTypeInfo.getOtherSRS();
Set<String> ftypeCrss = new HashSet<String>();
ftypeCrss.add(defaultSRS);
if (!config.isUseDefaultSrs()) {
ftypeCrss.addAll(otherSRS);
}
final boolean wfs1_1 = Versions.v1_1_0.equals(getServiceVersion());
if (wfs1_1) {
OperationType operationMetadata = getOperationMetadata(GET_FEATURE);
final String operationParameter = "SrsName";
Set<String> globalSrsNames = findParameters(operationMetadata, operationParameter);
ftypeCrss.addAll(globalSrsNames);
}
return ftypeCrss;
}
代码示例来源:origin: geotools/geotools
@Override
protected EObject createDescribeFeatureTypeRequestPost(DescribeFeatureTypeRequest request) {
final Wfs20Factory factory = Wfs20Factory.eINSTANCE;
DescribeFeatureTypeType dft = factory.createDescribeFeatureTypeType();
Version version = getServiceVersion();
dft.setService("WFS");
dft.setVersion(version.toString());
dft.setHandle(request.getHandle());
if (Versions.v1_0_0.equals(version)) {
dft.setOutputFormat(null);
}
QName typeName = request.getTypeName();
@SuppressWarnings("unchecked")
List<QName> typeNames = dft.getTypeName();
typeNames.add(typeName);
return dft;
}
代码示例来源:origin: geotools/geotools
@Override
protected DescribeFeatureTypeType createDescribeFeatureTypeRequestPost(
DescribeFeatureTypeRequest request) {
final WfsFactory factory = WfsFactory.eINSTANCE;
DescribeFeatureTypeType dft = factory.createDescribeFeatureTypeType();
Version version = getServiceVersion();
dft.setService("WFS");
dft.setVersion(version.toString());
dft.setHandle(request.getHandle());
if (Versions.v1_0_0.equals(version)) {
dft.setOutputFormat(null);
}
QName typeName = request.getTypeName();
@SuppressWarnings("unchecked")
List<QName> typeNames = dft.getTypeName();
typeNames.add(typeName);
return dft;
}
代码示例来源:origin: geotools/geotools
if (Versions.v1_0_0.equals(getServiceVersion())) {
SpatialCapabilities spatialCaps = filterCapabilities.getSpatialCapabilities();
if (spatialCaps != null) {
内容来源于网络,如有侵权,请联系作者删除!