code: public static Geometry offsetCurve(Geometry geometry, double offset, String parameters) {
          if(geometry == null){
              return null;
          }
          String[] buffParemeters = parameters.split("\\s+");
          BufferParameters bufferParameters = new BufferParameters();
          for (String params : buffParemeters) {
              String[] keyValue = params.split("=");
              if (keyValue[0].equalsIgnoreCase("endcap")) {
                  String param = keyValue[1];
                  if (param.equalsIgnoreCase("round")) {
                      bufferParameters.setEndCapStyle(BufferParameters.CAP_ROUND);
                  } else if (param.equalsIgnoreCase("flat") || param.equalsIgnoreCase("butt")) {
                      bufferParameters.setEndCapStyle(BufferParameters.CAP_FLAT);
                  } else if (param.equalsIgnoreCase("square")) {
                      bufferParameters.setEndCapStyle(BufferParameters.CAP_SQUARE);
                  } else {
                      throw new IllegalArgumentException("Supported join values are round, flat, butt or square.");
                  }
              } else if (keyValue[0].equalsIgnoreCase("join")) {
                  String param = keyValue[1];
                  if (param.equalsIgnoreCase("bevel")) {
                      bufferParameters.setJoinStyle(BufferParameters.JOIN_BEVEL);
                  } else if (param.equalsIgnoreCase("mitre") || param.equalsIgnoreCase("miter")) {
                      bufferParameters.setJoinStyle(BufferParameters.JOIN_MITRE);
                  } else if (param.equalsIgnoreCase("round")) {
                      bufferParameters.setJoinStyle(BufferParameters.JOIN_ROUND);
                  } else {
                      throw new IllegalArgumentException("Supported join values are bevel, mitre, miter or round.");
                  }
              } else if (keyValue[0].equalsIgnoreCase("mitre_limit") || keyValue[0].equalsIgnoreCase("miter_limit")) {
                  bufferParameters.setMitreLimit(Double.valueOf(keyValue[1]));
              } else if (keyValue[0].equalsIgnoreCase("quad_segs")) {
                  bufferParameters.setQuadrantSegments(Integer.valueOf(keyValue[1]));
              } else {
                  throw new IllegalArgumentException("Unknown parameters. Please read the documentation.");
              }
          }
          return computeOffsetCurve(geometry, offset, bufferParameters);
      }
docs: Return an offset line at a given distance and side from an input geometry
  @param geometry the geometry
  @param offset the distance
  @param parameters the buffer parameters
  @return