com.cognitect.transit.impl.URIImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of transit-java Show documentation
Show all versions of transit-java Show documentation
Transit is a data format and a set of libraries for conveying values between applications written in different languages. This library provides support for marshalling Transit data to/from Java.
// All rights reserved.
// Copyright (c) Cognitect, Inc.
package com.cognitect.transit.impl;
import com.cognitect.transit.URI;
public class URIImpl implements URI, Comparable {
String uri;
public URIImpl(String uri) {
this.uri = uri;
}
@Override
public String toString() {
return uri;
}
@Override
public String getValue() { return uri; }
@Override
public boolean equals(Object o) {
if(o == this)
return true;
if(o instanceof URIImpl && ((URIImpl)o).getValue().equals(getValue()))
return true;
else
return false;
}
@Override
public int hashCode() {
return 19 * getValue().hashCode();
}
@Override
public int compareTo(URI uri) {
return getValue().compareTo(((URIImpl)uri).getValue());
}
}