Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nested custom type how to define and use custom template #492

Open
shllove opened this issue Dec 14, 2018 · 1 comment
Open

nested custom type how to define and use custom template #492

shllove opened this issue Dec 14, 2018 · 1 comment
Labels

Comments

@shllove
Copy link

shllove commented Dec 14, 2018

hi there,
I have one custom type like:
@message
public class TwoTuple<T1, T2> implements Serializable {

/**
 * serialVersionUID
 */
private static final long serialVersionUID = -9116740696855326636L;

private T1 first;

private T2 second;

public TwoTuple() {
	
}

public TwoTuple(T1 first, T2 second) {
    this.first = first;
    this.second = second;
}

public T1 getFirst() {
    return first;
}

public void setFirst(T1 first) {
    this.first = first;
}

public T2 getSecond() {
    return second;
}

public void setSecond(T2 second) {
    this.second = second;
}

@Override
public String toString() {
    return "TwoTuple{" +
            "first=" + first +
            ", second=" + second +
            '}';
}

}

and I want to use this custom type in this scene:
@message
public class MyObject {
public Map<String, List<TwoTuple<String, TwoTuple<String, List>>>> formattedCascadeKeys;
}

but I don't know how to define my own template and use it, i can't deserialize from byte[], any help would be appreciated, thanks.

@shllove
Copy link
Author

shllove commented Dec 14, 2018

I use version 0.6.12

@xerial xerial added the v06 label Dec 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants