public static class SftpVersionSelector.NamedVersionSelector extends java.lang.Object implements SftpVersionSelector, NamedResource
SftpVersionSelector
and assigns it a name. Note: SftpVersionSelector.NamedVersionSelector
are
considered equal if they are assigned the same name - case insensitiveSftpVersionSelector.NamedVersionSelector
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
name |
protected SftpVersionSelector |
selector |
CURRENT, MAXIMUM, MINIMUM
BY_NAME_COMPARATOR, NAME_EXTRACTOR
Constructor and Description |
---|
NamedVersionSelector(java.lang.String name,
SftpVersionSelector selector) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getName() |
int |
hashCode() |
int |
selectVersion(ClientSession session,
boolean initial,
int current,
java.util.List<java.lang.Integer> available) |
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
fixedVersionSelector, preferredVersionSelector, preferredVersionSelector, resolveVersionSelector
findByName, findFirstMatchByName, getNameList, getNames, ofName, removeByName, safeCompareByName
protected final SftpVersionSelector selector
private final java.lang.String name
public NamedVersionSelector(java.lang.String name, SftpVersionSelector selector)
public int selectVersion(ClientSession session, boolean initial, int current, java.util.List<java.lang.Integer> available)
selectVersion
in interface SftpVersionSelector
session
- The ClientSession
through which the SFTP connection is madeinitial
- If true
then this is the initial version sent via SSH_FXP_INIT
otherwise it is
a re-negotiation.current
- The current version negotiated with the serveravailable
- Extra versions available - may be empty and/or contain only the current onepublic java.lang.String getName()
getName
in interface NamedResource
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object