/** * * Copyright (C) norad.fr * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package fr.norad.visuwall.providers.hudson.resource; 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.XmlRootElement; class Property { private String address; public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } } @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement(name = "user") public class HudsonUser { private String id; private String name; private String email; private List<Property> property = new ArrayList<Property>(); public String getId() { return id; } public void setId(String id) { this.id = id; } public String getEmail() { if (email != null) return email; if (property != null) { for (Property prop : property) { String email = prop.getAddress(); if (email != null) { return email; } } } return null; } public List<Property> getProperty() { return property; } public void setProperty(List<Property> property) { this.property = property; } public void setName(String name) { this.name = name; } public String getName() { return name; } public void setEmail(String email) { this.email = email; } }