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

kz.greetgo.logging.structure.parser.model.Range Maven / Gradle / Ivy

There is a newer version: 0.2.0
Show newest version
package kz.greetgo.logging.structure.parser.model;

import lombok.EqualsAndHashCode;
import lombok.RequiredArgsConstructor;

@EqualsAndHashCode
@RequiredArgsConstructor
public class Range {
  public final int start, end;

  public static Range of(int start, int end) {
    return new Range(start, end);
  }

  public static Range offsetCount(int offset, int count) {
    return of(offset, offset + count);
  }

  public int count() {
    return end - start;
  }

  public String toString() {
    return "Range(" + start + ':' + count() + ")";
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy