public class StandardVersionNegotiator extends Object implements VersionNegotiator
Modifier and Type | Field and Description |
---|---|
private int |
curVersion |
private List<Integer> |
versions |
Constructor and Description |
---|
StandardVersionNegotiator(int... supportedVersions) |
Modifier and Type | Method and Description |
---|---|
int |
getPreferredVersion() |
Integer |
getPreferredVersion(int maxVersion)
Gets the preferred version of this resource that is no greater than the given maxVersion.
|
List<Integer> |
getSupportedVersions() |
int |
getVersion() |
boolean |
isVersionSupported(int version)
Indicates whether or not the specified version is supported by this resource
|
void |
setVersion(int version)
Sets the version of this resource to the specified version.
|
public StandardVersionNegotiator(int... supportedVersions)
public int getVersion()
getVersion
in interface VersionNegotiator
public void setVersion(int version) throws IllegalArgumentException
VersionNegotiator
setVersion
in interface VersionNegotiator
version
- the version to setIllegalArgumentException
- if the given Version is not supported by this resource, as is indicated by the VersionNegotiator.isVersionSupported(int)
methodpublic int getPreferredVersion()
getPreferredVersion
in interface VersionNegotiator
public Integer getPreferredVersion(int maxVersion)
VersionNegotiator
maxVersion
, then null
is
returnedgetPreferredVersion
in interface VersionNegotiator
maxVersion
- the maximum version desiredpublic boolean isVersionSupported(int version)
VersionNegotiator
isVersionSupported
in interface VersionNegotiator
version
- the version to testpublic List<Integer> getSupportedVersions()
getSupportedVersions
in interface VersionNegotiator
Copyright © 2015 Apache NiFi Project. All rights reserved.