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

com.github.lontime.extjobrunr.beans.JobDashboardLogLinesBean Maven / Gradle / Ivy

package com.github.lontime.extjobrunr.beans;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import org.jobrunr.jobs.context.JobDashboardLogger.JobDashboardLogLines;
import org.joda.beans.Bean;
import org.joda.beans.BeanBuilder;
import org.joda.beans.JodaBeanUtils;
import org.joda.beans.MetaBean;
import org.joda.beans.MetaProperty;
import org.joda.beans.Property;
import org.joda.beans.gen.BeanDefinition;
import org.joda.beans.gen.PropertyDefinition;
import org.joda.beans.impl.direct.DirectBeanBuilder;
import org.joda.beans.impl.direct.DirectMetaBean;
import org.joda.beans.impl.direct.DirectMetaProperty;
import org.joda.beans.impl.direct.DirectMetaPropertyMap;

@BeanDefinition
public class JobDashboardLogLinesBean implements Bean {

    @PropertyDefinition
    private List logLines;

    public JobDashboardLogLinesBean() {
    }

    public JobDashboardLogLinesBean(JobDashboardLogLines logLines) {
        this.logLines = logLines.getLogLines().stream().map(s -> new JobDashboardLogLineBean(s)).collect(Collectors.toList());
    }

    public JobDashboardLogLines toJobDashboardLogLines() {
        final JobDashboardLogLines logLines = new JobDashboardLogLines();
        getLogLines().forEach(s -> logLines.add(s.toJobDashboardLogLine()));
        return logLines;
    }

    //------------------------- AUTOGENERATED START -------------------------
    /**
     * The meta-bean for {@code JobDashboardLogLinesBean}.
     * @return the meta-bean, not null
     */
    public static JobDashboardLogLinesBean.Meta meta() {
        return JobDashboardLogLinesBean.Meta.INSTANCE;
    }

    static {
        MetaBean.register(JobDashboardLogLinesBean.Meta.INSTANCE);
    }

    @Override
    public JobDashboardLogLinesBean.Meta metaBean() {
        return JobDashboardLogLinesBean.Meta.INSTANCE;
    }

    //-----------------------------------------------------------------------
    /**
     * Gets the logLines.
     * @return the value of the property
     */
    public List getLogLines() {
        return logLines;
    }

    /**
     * Sets the logLines.
     * @param logLines  the new value of the property
     */
    public void setLogLines(List logLines) {
        this.logLines = logLines;
    }

    /**
     * Gets the the {@code logLines} property.
     * @return the property, not null
     */
    public final Property> logLines() {
        return metaBean().logLines().createProperty(this);
    }

    //-----------------------------------------------------------------------
    @Override
    public JobDashboardLogLinesBean clone() {
        return JodaBeanUtils.cloneAlways(this);
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (obj != null && obj.getClass() == this.getClass()) {
            JobDashboardLogLinesBean other = (JobDashboardLogLinesBean) obj;
            return JodaBeanUtils.equal(getLogLines(), other.getLogLines());
        }
        return false;
    }

    @Override
    public int hashCode() {
        int hash = getClass().hashCode();
        hash = hash * 31 + JodaBeanUtils.hashCode(getLogLines());
        return hash;
    }

    @Override
    public String toString() {
        StringBuilder buf = new StringBuilder(64);
        buf.append("JobDashboardLogLinesBean{");
        int len = buf.length();
        toString(buf);
        if (buf.length() > len) {
            buf.setLength(buf.length() - 2);
        }
        buf.append('}');
        return buf.toString();
    }

    protected void toString(StringBuilder buf) {
        buf.append("logLines").append('=').append(JodaBeanUtils.toString(getLogLines())).append(',').append(' ');
    }

    //-----------------------------------------------------------------------
    /**
     * The meta-bean for {@code JobDashboardLogLinesBean}.
     */
    public static class Meta extends DirectMetaBean {
        /**
         * The singleton instance of the meta-bean.
         */
        static final Meta INSTANCE = new Meta();

        /**
         * The meta-property for the {@code logLines} property.
         */
        @SuppressWarnings({"unchecked", "rawtypes" })
        private final MetaProperty> logLines = DirectMetaProperty.ofReadWrite(
                this, "logLines", JobDashboardLogLinesBean.class, (Class) List.class);
        /**
         * The meta-properties.
         */
        private final Map> metaPropertyMap$ = new DirectMetaPropertyMap(
                this, null,
                "logLines");

        /**
         * Restricted constructor.
         */
        protected Meta() {
        }

        @Override
        protected MetaProperty metaPropertyGet(String propertyName) {
            switch (propertyName.hashCode()) {
                case 1995843099:  // logLines
                    return logLines;
            }
            return super.metaPropertyGet(propertyName);
        }

        @Override
        public BeanBuilder builder() {
            return new DirectBeanBuilder<>(new JobDashboardLogLinesBean());
        }

        @Override
        public Class beanType() {
            return JobDashboardLogLinesBean.class;
        }

        @Override
        public Map> metaPropertyMap() {
            return metaPropertyMap$;
        }

        //-----------------------------------------------------------------------
        /**
         * The meta-property for the {@code logLines} property.
         * @return the meta-property, not null
         */
        public final MetaProperty> logLines() {
            return logLines;
        }

        //-----------------------------------------------------------------------
        @Override
        protected Object propertyGet(Bean bean, String propertyName, boolean quiet) {
            switch (propertyName.hashCode()) {
                case 1995843099:  // logLines
                    return ((JobDashboardLogLinesBean) bean).getLogLines();
            }
            return super.propertyGet(bean, propertyName, quiet);
        }

        @SuppressWarnings("unchecked")
        @Override
        protected void propertySet(Bean bean, String propertyName, Object newValue, boolean quiet) {
            switch (propertyName.hashCode()) {
                case 1995843099:  // logLines
                    ((JobDashboardLogLinesBean) bean).setLogLines((List) newValue);
                    return;
            }
            super.propertySet(bean, propertyName, newValue, quiet);
        }

    }

    //-------------------------- AUTOGENERATED END --------------------------
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy