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

com.github.datalking.beans.factory.config.RuntimeBeanNameReference Maven / Gradle / Ivy

package com.github.datalking.beans.factory.config;

import com.github.datalking.util.Assert;

/**
 * @author yaoo on 5/29/18
 */
public class RuntimeBeanNameReference implements BeanReference {

    private final String beanName;

    private Object source;

    public RuntimeBeanNameReference(String beanName) {
        Assert.hasText(beanName, "'beanName' must not be empty");
        this.beanName = beanName;
    }

    public String getBeanName() {
        return this.beanName;
    }

    public void setSource(Object source) {
        this.source = source;
    }

    public Object getSource() {
        return this.source;
    }

    @Override
    public boolean equals(Object other) {
        if (this == other) {
            return true;
        }
        if (!(other instanceof RuntimeBeanNameReference)) {
            return false;
        }
        RuntimeBeanNameReference that = (RuntimeBeanNameReference) other;
        return this.beanName.equals(that.beanName);
    }

    @Override
    public int hashCode() {
        return this.beanName.hashCode();
    }

    @Override
    public String toString() {
        return '<' + getBeanName() + '>';
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy