All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cognitect.transit.impl.URIImpl Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 1.0.371
Show newest version
// 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());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy