com.github.jknack.semver
Class Semver

java.lang.Object
  extended by com.github.jknack.semver.Semver
All Implemented Interfaces:
Comparable<Semver>

public abstract class Semver
extends Object
implements Comparable<Semver>

A semantic version.

Since:
0.0.1
Author:
edgar.espina

Nested Class Summary
static class Semver.Type
           
 
Field Summary
static Semver ANY
          Match any version.
static Comparator<String> DESC
           
static Semver LATEST
          Identify the latest version of a dependency.
 
Constructor Summary
Semver()
           
 
Method Summary
abstract  int compareTo(Semver expr)
           
static Semver create(String version)
          Parse a version expression.
abstract  boolean isStatic()
           
abstract  boolean matches(Semver expr)
          True if the given expression matches.
abstract  boolean matches(String expr)
          True if the given expression matches.
abstract  String text()
           
 String toString()
           
abstract  Semver.Type type()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LATEST

public static final Semver LATEST
Identify the latest version of a dependency.


DESC

public static final Comparator<String> DESC

ANY

public static final Semver ANY
Match any version.

Constructor Detail

Semver

public Semver()
Method Detail

matches

public abstract boolean matches(Semver expr)
True if the given expression matches.

Parameters:
expr - The candidate expression.
Returns:
True if the given expression matches.

matches

public abstract boolean matches(String expr)
True if the given expression matches.

Parameters:
expr - The candidate expression.
Returns:
True if the given expression matches.

compareTo

public abstract int compareTo(Semver expr)
Specified by:
compareTo in interface Comparable<Semver>

isStatic

public abstract boolean isStatic()

text

public abstract String text()

type

public abstract Semver.Type type()

toString

public String toString()
Overrides:
toString in class Object

create

public static Semver create(String version)
Parse a version expression.

Parameters:
version - A version expression.
Returns:
An expression.


Copyright © 2013. All Rights Reserved.