class RangeConverter {

  @Nullable
  public static TextRange parse(@Nullable String value) {
    if (value == null) {
      return null;
    }
    String[] values = value.split(":", 4);
    if (values.length != 4) {
      throw new IllegalArgumentException("Invalid TextRange '" + value + "'");
    }
    int startLine = Integer.parseInt(values[0]);
    int startLineOffset = Integer.parseInt(values[1]);
    int endLine = Integer.parseInt(values[2]);
    int endLineOffset = Integer.parseInt(values[3]);
    return new TextRangeImpl(startLine, startLineOffset, endLine, endLineOffset);
  }

  private  RangeConverter();

}