Last active
October 24, 2021 06:53
-
-
Save ashutoshmeher-r3/8dd598479b08e20f026db6d27a6a20ee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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