I got a class "Transaction" with Attributes in it like the id(byte[]), sender(byte[]), receiver(byte[]) and amount (double).
public class Transaction implements Serializable
{
private transient byte[] txId;
private byte[] sender;
private byte[] receiver;
private double amount;
Now I want to display these attributes in a TableView and this is the Method I´m using for:
@FXML
void refreshButtonPressed(ActionEvent event) {
List<Transaction> incomingList =
DependencyManager.getAccountStorage().getAccount(publicKey).getIncomingTransactions();
incomingTransactions = FXCollections.observableList(incomingList);
idCol.setCellValueFactory(new PropertyValueFactory<Transaction, String>("txId"));
senderCol.setCellValueFactory(new PropertyValueFactory<Transaction, String>("sender"));
receiverCol.setCellValueFactory(new PropertyValueFactory<Transaction, String>("receiver"));
amountCol.setCellValueFactory(new PropertyValueFactory<Transaction, String>("amount"));
incomingView.setItems(incomingTransactions);
}
Well the good thing is - it works, basically. But i want to convert to byte[] to a String with my own converter i wrote because this standard byte to String conversion is not really readable by the User.
Thats the method im using for the conversion: (Its from bouncycastle).
public static String digestToHex( byte[] digest )
{
return Hex.toHexString( digest );
}
So is there any way to convert the data before it is displayed?