return false; } else if (!delete.equals(other.delete)) { return false; return false; } else if (!get.equals(other.get)) { return false; return false; } else if (!head.equals(other.head)) { return false; return false; } else if (!options.equals(other.options)) { return false; } else if (!patch.equals(other.patch)) { return false; } else if (!post.equals(other.post)) { return false; } else if (!put.equals(other.put)) { return false;
public static OperationDescription operationDescriptionOf(final Swagger swagger, final Operation operation) { final Entry<String, Path> pathEntry = swagger.getPaths().entrySet().stream() .filter(e -> e.getValue().getOperations().contains(operation)).findFirst().get(); final String path = pathEntry.getKey(); final Entry<HttpMethod, Operation> operationEntry = pathEntry.getValue().getOperationMap().entrySet().stream() .filter(e -> e.getValue().equals(operation)).findFirst().get(); final HttpMethod method = operationEntry.getKey(); final String specifiedSummary = trimToNull(operation.getSummary()); final String specifiedDescription = trimToNull(operation.getDescription()); final String name = ofNullable(specifiedSummary).orElseGet(() -> method + " " + path); final String description = ofNullable(specifiedDescription).orElseGet(() -> "Send " + method + " request to " + path); return new OperationDescription(name, description); }
public static OperationDescription operationDescriptionOf(final Swagger swagger, final Operation operation, final BiFunction<String, String, String> consumer) { final Entry<String, Path> pathEntry = swagger.getPaths().entrySet().stream() .filter(e -> e.getValue().getOperations().contains(operation)).findFirst().get(); final String path = pathEntry.getKey(); final Entry<HttpMethod, Operation> operationEntry = pathEntry.getValue().getOperationMap().entrySet().stream() .filter(e -> e.getValue().equals(operation)).findFirst().get(); final HttpMethod method = operationEntry.getKey(); final String specifiedSummary = trimToNull(operation.getSummary()); final String specifiedDescription = trimToNull(operation.getDescription()); final String name = ofNullable(toLiteralNull(specifiedSummary)).orElseGet(() -> method + " " + path); final String description = ofNullable(toLiteralNull(specifiedDescription)) .orElseGet(() -> consumer.apply(method.name(), path)); return new OperationDescription(name, description); }
public static OperationDescription operationDescriptionOf(final Swagger swagger, final Operation operation) { final Entry<String, Path> pathEntry = swagger.getPaths().entrySet().stream() .filter(e -> e.getValue().getOperations().contains(operation)).findFirst().get(); final String path = pathEntry.getKey(); final Entry<HttpMethod, Operation> operationEntry = pathEntry.getValue().getOperationMap().entrySet().stream() .filter(e -> e.getValue().equals(operation)).findFirst().get(); final HttpMethod method = operationEntry.getKey(); final String specifiedSummary = trimToNull(operation.getSummary()); final String specifiedDescription = trimToNull(operation.getDescription()); final String name = ofNullable(toLiteralNull(specifiedSummary)).orElseGet(() -> method + " " + path); final String description = ofNullable(toLiteralNull(specifiedDescription)) .orElseGet(() -> "Send " + method + " request to " + path); return new OperationDescription(name, description); }