All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fastjrun.example.dto.BaseListPacket Maven / Gradle / Ivy

There is a newer version: 3.0
Show newest version
/*
 * Copyright (C) 2019 fastjrun, Inc. All Rights Reserved.
 */
package com.fastjrun.example.dto;

import java.util.List;

import javax.xml.bind.annotation.XmlElement;

public abstract class BaseListPacket {

    private T head;

    private List body;

    public T getHead() {
        return head;
    }

    @XmlElement
    public void setHead(T head) {
        this.head = head;
    }

    public List getBody() {
        return body;
    }

    @XmlElement
    public void setBody(List body) {
        this.body = body;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(this.getClass().getSimpleName());
        sb.append("[head=").append(this.head);
        sb.append(",body=");
        if (this.body != null) {
            sb.append("[");
            for (int i = 0; i < this.body.size(); i++) {
                if (i > 0) {
                    sb.append(",");
                }
                sb.append(this.body.get(i));
            }
            sb.append("]");
        } else {
            sb.append(this.body);
        }
        sb.append("]");
        return sb.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy