I'm deserializing a Java bean from an Excel spreadsheets using [Xcelite][1], and I've an attribute within it which can match more than one column name in different spreadsheets.
This is my Java Bean
import com.ebay.xcelite.annotations.Column;
public class User {
@Column(name = "User")
private String username;
@Column(name = "Email")
private String email;
}
I must deserialize the same object using another spreadsheet which instead of use User column name it use Login.
I could use the solution below, but I'd like to know if is there a better one ?
public class User {
@Column(name = "User")
private String username;
@Column(name = "Login")
private String login;
@Column(name = "Email")
private String email;
public String getUsername() {
return username != null ? username : login;
}
}
See https://stackoverflow.com/questions/57919157/how-to-declare-more-than-one-column-name-using-xcelite-library
I'm deserializing a Java bean from an Excel spreadsheets using [Xcelite][1], and I've an attribute within it which can match more than one column name in different spreadsheets.
This is my Java Bean
I must deserialize the same object using another spreadsheet which instead of use
Usercolumn name it useLogin.I could use the solution below, but I'd like to know if is there a better one ?
See https://stackoverflow.com/questions/57919157/how-to-declare-more-than-one-column-name-using-xcelite-library