Skip to content

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

Open
@shllove

Description

@shllove

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions