001/*
002 * Logback: the reliable, generic, fast and flexible logging framework.
003 * Copyright (C) 1999-2026, QOS.ch. All rights reserved.
004 *
005 * This program and the accompanying materials are dual-licensed under
006 * either the terms of the Eclipse Public License v2.0 as published by
007 * the Eclipse Foundation
008 *
009 *   or (per the licensee's choosing)
010 *
011 * under the terms of the GNU Lesser General Public License version 2.1
012 * as published by the Free Software Foundation.
013 */
014package ch.qos.logback.core.model.processor;
015
016import ch.qos.logback.core.model.Model;
017
018/**
019 * Defines the relation between a depender (of type Model) and a dependency name (String).
020 * 
021 * Note that a depender may have multiple dependencies but
022 * {@link DependencyDefinition} applies to just one dependency relation.
023 * 
024 * @author ceki
025 *
026 */
027public class DependencyDefinition {
028
029    // depender depends on dependency (new terminology)
030    // dependency synonym dependee
031    // depender synonym dependent
032
033    // OLD terminology: dependee (=dependency), dependent(=depender)
034    //
035    // NEW terminology: *dependent*: a component of type Model which depends on a *dependency*
036    Model depender;
037    // dependee or dependency: the string name of a component depended upon by the depender of type Model
038    String dependency;
039    
040    public DependencyDefinition(Model depender, String dependency) {
041        this.depender = depender;
042        this.dependency = dependency;
043        
044        
045    }
046    
047    public String getDependency() {
048        return dependency;
049    }
050
051    public Model getDepender() {
052        return depender;
053    }
054
055
056    @Override
057    public String toString() {
058        return "DependencyDefinition{" +
059                "depender=" + depender +
060                ", dependency='" + dependency + '\'' +
061                '}';
062    }
063}