Skip to content

Instantly share code, notes, and snippets.

@ashutoshmeher-r3
Last active October 24, 2021 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashutoshmeher-r3/8dd598479b08e20f026db6d27a6a20ee to your computer and use it in GitHub Desktop.
Save ashutoshmeher-r3/8dd598479b08e20f026db6d27a6a20ee to your computer and use it in GitHub Desktop.
@BelongsToContract(LandTitleContract.class)
public class LandTitleState implements ContractState, JsonRepresentable {
/* This is the unique identifier of the property */
private String plotNumber;
private String dimensions;
private String area;
private Party owner;
private Party issuer;
/* Constructor of our Corda state */
public LandTitleState(String plotNumber, String dimensions, String area, Party owner, Party issuer) {
this.plotNumber = plotNumber;
this.dimensions = dimensions;
this.area = area;
this.owner = owner;
this.issuer = issuer;
}
//Getters
public String getPlotNumber() {
return plotNumber;
}
public Party getOwner() {
return owner;
}
public Party getIssuer() {
return issuer;
}
public String getDimensions() {
return dimensions;
}
public String getArea() {
return area;
}
/* This method will indicate who are the participants and required signers when
* this state is used in a transaction. */
@NotNull
@Override
public List<AbstractParty> getParticipants() {
return Arrays.asList(issuer, owner);
}
@NotNull
@Override
public String toJsonString() {
return "plotNumber: " + plotNumber +
" dimensions: " + dimensions +
" area: " + area +
" owner: " + owner +
" issuer: " + issuer;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment