Skip to content

Commit

Permalink
Adds getResourceName as API contract for Resource
Browse files Browse the repository at this point in the history
Signed-off-by: Darshit Chanpura <[email protected]>
  • Loading branch information
DarshitChanpura committed Dec 20, 2024
1 parent 1aff350 commit f90b165
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,16 @@ public String getWriteableName() {
}

@Override
public void writeTo(StreamOutput out) throws IOException {

}
public void writeTo(StreamOutput out) {}

@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
return null;
}

@Override
public String getResourceName() {
return name;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,12 @@
/**
* Marker interface for all resources
*/
public interface Resource extends NamedWriteable, ToXContentFragment {}
public interface Resource extends NamedWriteable, ToXContentFragment {
/**
* Get the resource name
* @return resource name
*/
String getResourceName();

// TODO: Next iteration, check if getResourceType() should be implemented
}

0 comments on commit f90b165

Please sign in to comment.