blob: 805cbef029af37eeb758452585114ad55b9e7cf3 [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.apache.dubbo.admin.registry.common.domain;
import java.util.ArrayList;
import java.util.List;
/**
* DependItem
*
*/
public class DependItem {
private final List<Integer> recursives = new ArrayList<Integer>();
private String application;
private int index;
private int level;
private DependItem parent;
public DependItem() {
}
public DependItem(String application, int level) {
this.application = application;
this.level = level;
}
public DependItem(DependItem parent, String application, int level, int index) {
this.parent = parent;
this.application = application;
this.level = level;
this.index = index;
}
public int getLevel() {
return level;
}
public void setLevel(int level) {
this.level = level;
}
public String getApplication() {
return application;
}
public void setApplication(String application) {
this.application = application;
}
public int getIndex() {
return index;
}
public void setIndex(int index) {
this.index = index;
}
public DependItem getParent() {
return parent;
}
public void setParent(DependItem parent) {
this.parent = parent;
}
public List<Integer> getRecursives() {
return recursives;
}
public void addRecursive(int padding, int value) {
while (recursives.size() < padding) {
recursives.add(0);
}
recursives.add(value);
}
public String toString() {
return "DependItem [application=" + application + ", index=" + index + ", level=" + level
+ "]";
}
}