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

org.cattleframework.cloud.discovery.DiscoveryInfoProperties Maven / Gradle / Ivy

There is a newer version: 1.0.1-M5
Show newest version
/*
 * Copyright (C) 2018 the original author or authors.
 *
 * 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 org.cattleframework.cloud.discovery;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * 服务发现信息属性配置
 * 
 * @author orange
 *
 */
@ConfigurationProperties("cattle.cloud.discovery")
public class DiscoveryInfoProperties {

    private String version = "1.0.0";

    private final Metadata metadata = new Metadata();

    private List headers;

    public String getVersion() {
	return version;
    }

    public void setVersion(String version) {
	this.version = version;
    }

    public Metadata getMetadata() {
	return metadata;
    }

    public List getHeaders() {
	if (CollectionUtils.isEmpty(headers)) {
	    headers = new ArrayList();
	}
	return headers;
    }

    public void setHeaders(List headers) {
	this.headers = headers;
    }

    public static class Metadata {

	private Map content;

	private List transitive;

	private List disposable;

	public Map getContent() {
	    if (MapUtils.isEmpty(content)) {
		content = new HashMap(0);
	    }
	    return content;
	}

	public void setContent(Map content) {
	    this.content = content;
	}

	public List getTransitive() {
	    if (CollectionUtils.isEmpty(transitive)) {
		transitive = new ArrayList();
	    }
	    return transitive;
	}

	public void setTransitive(List transitive) {
	    this.transitive = transitive;
	}

	public List getDisposable() {
	    if (CollectionUtils.isEmpty(disposable)) {
		disposable = new ArrayList();
	    }
	    return disposable;
	}

	public void setDisposable(List disposable) {
	    this.disposable = disposable;
	}
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy