@Override public int compareTo(Item item) { if (item == null) { return BIG_INTEGER_ZERO.equals(value) ? 0 : 1; // 1.0 == 1, 1.1 // > 1 } switch (item.getType()) { case INTEGER_ITEM : return value.compareTo(((IntegerItem) item).value); case STRING_ITEM : return 1; // 1.1 > 1-sp case LIST_ITEM : return 1; // 1.1 > 1-1 default : throw new RuntimeException("invalid item: " + item.getClass()); } }
@Override public int compareTo(Item item) { if (item == null) { return BIG_INTEGER_ZERO.equals(value) ? 0 : 1; // 1.0 == 1, 1.1 // > 1 } switch (item.getType()) { case INTEGER_ITEM : return value.compareTo(((IntegerItem) item).value); case STRING_ITEM : return 1; // 1.1 > 1-sp case LIST_ITEM : return 1; // 1.1 > 1-1 default : throw new RuntimeException("invalid item: " + item.getClass()); } }
@Override public int compareTo(Item item) { if (item == null) { return BIG_INTEGER_ZERO.equals(value) ? 0 : 1; // 1.0 == 1, 1.1 // > 1 } switch (item.getType()) { case INTEGER_ITEM : return value.compareTo(((IntegerItem) item).value); case STRING_ITEM : return 1; // 1.1 > 1-sp case LIST_ITEM : return 1; // 1.1 > 1-1 default : throw new RuntimeException("invalid item: " + item.getClass()); } }
return first.compareTo(null); switch (item.getType()) { case INTEGER_ITEM : return -1; // 1-1 < 1.0.x
return first.compareTo(null); switch (item.getType()) { case INTEGER_ITEM : return -1; // 1-1 < 1.0.x
return first.compareTo(null); switch (item.getType()) { case INTEGER_ITEM : return -1; // 1-1 < 1.0.x
return first.compareTo(null); switch (item.getType()) { case INTEGER_ITEM : return -1; // 1-1 < 1.0.x
@Override public int compareTo(Item item) { if (item == null) { // 1-rc < 1, 1-ga > 1 return comparableQualifier(value).compareTo(RELEASE_VERSION_INDEX); } switch (item.getType()) { case INTEGER_ITEM : return -1; // 1.any < 1.1 ? case STRING_ITEM : return comparableQualifier(value).compareTo(comparableQualifier(((StringItem) item).value)); case LIST_ITEM : return -1; // 1.any < 1-1 default : throw new RuntimeException("invalid item: " + item.getClass()); } }
@Override public int compareTo(Item item) { if (item == null) { return BIG_INTEGER_ZERO.equals(value) ? 0 : 1; // 1.0 == 1, 1.1 // > 1 } switch (item.getType()) { case INTEGER_ITEM : return value.compareTo(((IntegerItem) item).value); case STRING_ITEM : return 1; // 1.1 > 1-sp case LIST_ITEM : return 1; // 1.1 > 1-1 default : throw new RuntimeException("invalid item: " + item.getClass()); } }
@Override public int compareTo(Item item) { if (item == null) { // 1-rc < 1, 1-ga > 1 return comparableQualifier(value).compareTo(RELEASE_VERSION_INDEX); } switch (item.getType()) { case INTEGER_ITEM : return -1; // 1.any < 1.1 ? case STRING_ITEM : return comparableQualifier(value).compareTo(comparableQualifier(((StringItem) item).value)); case LIST_ITEM : return -1; // 1.any < 1-1 default : throw new RuntimeException("invalid item: " + item.getClass()); } }
@Override public int compareTo(Item item) { if (item == null) { // 1-rc < 1, 1-ga > 1 return comparableQualifier(value).compareTo(RELEASE_VERSION_INDEX); } switch (item.getType()) { case INTEGER_ITEM : return -1; // 1.any < 1.1 ? case STRING_ITEM : return comparableQualifier(value).compareTo(comparableQualifier(((StringItem) item).value)); case LIST_ITEM : return -1; // 1.any < 1-1 default : throw new RuntimeException("invalid item: " + item.getClass()); } }
@Override public int compareTo(Item item) { if (item == null) { // 1-rc < 1, 1-ga > 1 return comparableQualifier(value).compareTo(RELEASE_VERSION_INDEX); } switch (item.getType()) { case INTEGER_ITEM : return -1; // 1.any < 1.1 ? case STRING_ITEM : return comparableQualifier(value).compareTo(comparableQualifier(((StringItem) item).value)); case LIST_ITEM : return -1; // 1.any < 1-1 default : throw new RuntimeException("invalid item: " + item.getClass()); } }