Commit f0490588 authored by Nicola Fulvio Calabria's avatar Nicola Fulvio Calabria
Browse files

added collection utilities

parent a776864b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
/*
 * This file is part of vospace-rest
 * This file is part of vospace-datamodel
 * Copyright (C) 2021 Istituto Nazionale di Astrofisica
 * SPDX-License-Identifier: GPL-3.0-or-later
 */
+3 −3
Original line number Diff line number Diff line
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 * This file is part of vospace-datamodel
 * Copyright (C) 2021 Istituto Nazionale di Astrofisica
 * SPDX-License-Identifier: GPL-3.0-or-later
 */
package it.inaf.oats.vospace.datamodel.collections;

+47 −0
Original line number Diff line number Diff line
/*
 * This file is part of vospace-datamodel
 * Copyright (C) 2021 Istituto Nazionale di Astrofisica
 * SPDX-License-Identifier: GPL-3.0-or-later
 */
package it.inaf.oats.vospace.datamodel.collections;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Nicola Fulvio Calabria <nicola.calabria at inaf.it>
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "node-details")
public class NodeDetails {

    @XmlAttribute(name = "node-id", required = true)
    private Long nodeId;

    @XmlAttribute(name = "node-vos-path", required = true)
    private String nodeVosPath;

    public NodeDetails() {
        // no op       
    }

    public Long getNodeId() {
        return nodeId;
    }

    public void setNodeId(Long nodeId) {
        this.nodeId = nodeId;
    }

    public String getNodeVosPath() {
        return nodeVosPath;
    }

    public void setNodeVosPath(String nodeVosPath) {
        this.nodeVosPath = nodeVosPath;
    }

}
+41 −0
Original line number Diff line number Diff line
/*
 * This file is part of vospace-datamodel
 * Copyright (C) 2021 Istituto Nazionale di Astrofisica
 * SPDX-License-Identifier: GPL-3.0-or-later
 */
package it.inaf.oats.vospace.datamodel.collections;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * Wrapper class for REST GET
 *
 * @author Nicola Fulvio Calabria <nicola.calabria at inaf.it>
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "node-details-wrapper")
public class NodeDetailsWrapper {

    @XmlElementWrapper(name = "node-details-list", required = true)
    @XmlElement(name = "node-details")
    private List<NodeDetails> nodeDetails;

    public NodeDetailsWrapper() {
        nodeDetails = new ArrayList<NodeDetails>();
    }

    public List<NodeDetails> getNodeDetails() {
        return nodeDetails;
    }

    public void setNodeDetails(List<NodeDetails> nodeDetails) {
        this.nodeDetails = nodeDetails;
    }

}