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

net.jeremybrooks.jinx.response.commons.Institutions Maven / Gradle / Ivy

/*
 * Jinx is Copyright 2010-2023 by Jeremy Brooks and Contributors
 *
 * Jinx is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Jinx is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Jinx.  If not, see .
 */

package net.jeremybrooks.jinx.response.commons;

import com.google.gson.annotations.SerializedName;
import net.jeremybrooks.jinx.response.Response;
import net.jeremybrooks.jinx.response.photos.PhotoInfo;

import java.io.Serializable;
import java.util.List;

/**
 * Represents data returned from flickr.commons.getInstitutions
 *
 * @author Jeremy Brooks
 */
public class Institutions extends Response {

	private static final long serialVersionUID = 2536848647563859996L;
	private _Institutions institutions;

	public List getInstitutionList() {
		return institutions == null ? null : institutions.institutionList;
	}


	private class _Institutions implements Serializable {
		private static final long serialVersionUID = -5729230786906878058L;
		@SerializedName("institution")
		private List institutionList;
	}

	public class Institution implements Serializable {
		private static final long serialVersionUID = 5918710496801933243L;
        @SerializedName("nsid")
		private String institutionId;
		@SerializedName("date_launch")
		private String dateLaunch;
		private _Name name;
		private _Urls urls;


		public String getInstitutionId() {
			return institutionId;
		}
		public String getDateLaunch() {
			return dateLaunch;
		}
		public String getName() {
			return name == null ? null : name._content;
		}
		public List getUrlList() {
			return urls == null ? null : urls.urlList;
		}

		private class _Name implements Serializable {
			private static final long serialVersionUID = 4415446808172702635L;
			private String _content;
		}
		private class _Urls implements Serializable {
			private static final long serialVersionUID = -3681081818589443047L;
			@SerializedName("url")
			private List urlList;
		}


		@Override
		public String toString() {
			final StringBuilder sb = new StringBuilder();
			sb.append("net.jeremybrooks.jinx.response.commons.Institutions.Institution");
			sb.append("{institutionId='").append(institutionId).append('\'');
			sb.append(" | dateLaunch='").append(dateLaunch).append('\'');
			sb.append(" | name=").append(name);
			sb.append(" | urlList=").append(getUrlList() == null ? "null" : getUrlList().size() + " elements");
			sb.append('}');
			return sb.toString();
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy