-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Frank Lou <mloufra@amazon.com>
- Loading branch information
Showing
4 changed files
with
69 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
server/src/main/java/org/opensearch/extensions/ExtensionDenpendency.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package org.opensearch.extensions; | ||
|
||
import java.io.IOException; | ||
import java.util.Objects; | ||
|
||
import org.opensearch.Version; | ||
import org.opensearch.common.io.stream.StreamInput; | ||
import org.opensearch.common.io.stream.StreamOutput; | ||
import org.opensearch.common.io.stream.Writeable; | ||
|
||
public class ExtensionDenpendency implements Writeable { | ||
public String uniqueId; | ||
public Version version; | ||
|
||
public ExtensionDenpendency(String uniqueId, Version version){ | ||
this.uniqueId = uniqueId; | ||
this.version = version; | ||
} | ||
|
||
public ExtensionDenpendency(StreamInput in) throws IOException { | ||
uniqueId = in.readString(); | ||
version = Version.readVersion(in); | ||
} | ||
|
||
@Override | ||
public void writeTo(StreamOutput out) throws IOException { | ||
out.writeString(uniqueId); | ||
Version.writeVersion(version, out); | ||
} | ||
|
||
public String getUniqueId(){ | ||
return uniqueId; | ||
} | ||
|
||
public Version getVersion(){ | ||
return version; | ||
} | ||
|
||
public String toString() { | ||
return "RestActionsRequest{uniqueId=" + uniqueId + ", version=" + version + "}"; | ||
} | ||
|
||
public boolean equals(Object obj) { | ||
if (this == obj) return true; | ||
if (obj == null || getClass() != obj.getClass()) return false; | ||
ExtensionDenpendency that = (ExtensionDenpendency) obj; | ||
return Objects.equals(uniqueId, that.uniqueId) && Objects.equals(version, that.version); | ||
} | ||
|
||
public int hashCode() { | ||
return Objects.hash(uniqueId, version); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters