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 VersionNegotiatorpublic void setVersion(int version)
throws IllegalArgumentException
VersionNegotiatorsetVersion in interface VersionNegotiatorversion - 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 VersionNegotiatorpublic Integer getPreferredVersion(int maxVersion)
VersionNegotiatormaxVersion, then null is
returnedgetPreferredVersion in interface VersionNegotiatormaxVersion - the maximum version desiredpublic boolean isVersionSupported(int version)
VersionNegotiatorisVersionSupported in interface VersionNegotiatorversion - the version to testpublic List<Integer> getSupportedVersions()
getSupportedVersions in interface VersionNegotiatorCopyright © 2019 Apache NiFi Project. All rights reserved.