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

org.mockserver.dashboard.serializers.LogMessageDescription Maven / Gradle / Ivy

There is a newer version: 5.15.0
Show newest version
package org.mockserver.dashboard.serializers;

import org.apache.commons.lang3.StringUtils;

public class LogMessageDescription implements Description {
    final String firstPart;
    final String secondPart;
    final int length;
    final DescriptionProcessor descriptionProcessor;

    public LogMessageDescription(String firstPart, String secondPart, DescriptionProcessor descriptionProcessor) {
        this.firstPart = firstPart;
        this.secondPart = secondPart;
        this.length = firstPart.length() + secondPart.length();
        this.descriptionProcessor = descriptionProcessor;
    }

    public int length() {
        return length + 1;
    }

    public String toObject() {
        return firstPart + " " + secondPart + StringUtils.repeat(" ", descriptionProcessor.getMaxLogEventLength() - length + 1) + " ";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy