Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 51 additions & 4 deletions mcp-core/src/main/java/io/modelcontextprotocol/spec/McpSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -1212,11 +1212,16 @@ public static Builder builder(String uri, String name) {
return new Builder(uri, name);
}

@Deprecated
public static Builder builder() {
return new Builder();
}

public static class Builder {

private final String uri;
private /* final */ String uri;

private final String name;
private /* final */ String name;

private String title;

Expand All @@ -1230,6 +1235,24 @@ public static class Builder {

private Map<String, Object> meta;

@Deprecated
public Builder() {
}

@Deprecated
public Builder uri(String uri) {
Assert.hasText(uri, "uri must not be empty");
this.uri = uri;
return this;
}

@Deprecated
public Builder name(String name) {
this.name = name;
Assert.hasText(name, "name must not be empty");
return this;
}

private Builder(String uri, String name) {
Assert.hasText(uri, "uri must not be empty");
Assert.hasText(name, "name must not be empty");
Expand Down Expand Up @@ -1330,11 +1353,16 @@ public static Builder builder(String uriTemplate, String name) {
return new Builder(uriTemplate, name);
}

@Deprecated
public static Builder builder() {
return new Builder();
}

public static class Builder {

private final String uriTemplate;
private /* final */ String uriTemplate;

private final String name;
private /* final */ String name;

private String title;

Expand All @@ -1346,13 +1374,32 @@ public static class Builder {

private Map<String, Object> meta;

@Deprecated
private Builder() {

}

private Builder(String uriTemplate, String name) {
Assert.hasText(uriTemplate, "uriTemplate must not be empty");
Assert.hasText(name, "name must not be empty");
this.uriTemplate = uriTemplate;
this.name = name;
}

@Deprecated
public Builder uriTemplate(String uriTemplate) {
Assert.hasText(uriTemplate, "uriTemplate must not be empty");
this.uriTemplate = uriTemplate;
return this;
}

@Deprecated
public Builder name(String name) {
Assert.hasText(name, "name must not be empty");
this.name = name;
return this;
}

public Builder title(String title) {
this.title = title;
return this;
Expand Down
Loading