IppImageAnchorS3File.java 3.34 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.scene7.is.ipp.messages;

import com.scene7.is.ipp.messages.Ipp;
import com.scene7.is.ipp.messages.IppByte;
import com.scene7.is.ipp.messages.IppImageAnchor;
import com.scene7.is.ipp.messages.IppImageAnchorType;
import com.scene7.is.ipp.messages.IppInt;
import com.scene7.is.ipp.messages.IppString;
import com.scene7.is.ipp.messages.Offset;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.io.Writer;

public class IppImageAnchorS3File
extends IppImageAnchor {
    private String value_;

    public IppImageAnchorS3File(String value) {
        this.value_ = value;
    }

    public String toString() {
        StringBuffer buffer = new StringBuffer();
        buffer.append("[");
        buffer.append("value: ").append(String.valueOf(this.value_)).append(" ");
        buffer.append("]");
        return buffer.toString();
    }

    public boolean equals(Object o) {
        if (!(o instanceof IppImageAnchorS3File)) {
            return false;
        }
        IppImageAnchorS3File e = (IppImageAnchorS3File)o;
        if (!this.value_.equals(e.value_)) {
            return false;
        }
        return true;
    }

    public static IppImageAnchorS3File UnstuffDerived(byte[] arr, Offset arrayPos) {
        Ipp.Assert((arrayPos.val & 3) == 0, "IppImageAnchorS3File align");
        int type = IppInt.Unstuff(arr, arrayPos);
        String value = IppString.Unstuff(arr, arrayPos);
        IppByte.UnstuffFixedArray(arr, arrayPos, 40);
        Ipp.Assert(type == 65547, "IppImageAnchorS3File enum id");
        return new IppImageAnchorS3File(value);
    }

    public static void StuffDerived(byte[] arr, Offset arrayPos, Offset varPos, IppImageAnchorS3File val) {
        Ipp.Assert((arrayPos.val & 3) == 0, "IppImageAnchorS3File align");
        if (val != null) {
            IppInt.Stuff(arr, arrayPos, varPos, val.type());
            IppString.Stuff(arr, arrayPos, varPos, val.value());
            Ipp.StuffNullBytes(arr, arrayPos, 40);
        } else {
            Ipp.StuffNullBytes(arr, arrayPos, 48);
        }
    }

    public static void Print(Writer tf, String label, IppImageAnchorS3File it) throws IOException {
        String ll = label + "IppImageAnchorS3File: ";
        if (it == null) {
            tf.write(ll + "NULL!!\n");
            return;
        }
        tf.write(ll + "\n");
        IppImageAnchorType.Print(tf, ll + "type: ", it.type());
        IppString.Print(tf, ll + "value: ", it.value());
    }

    public static void PrintArray(Writer tf, String label, IppImageAnchorS3File[] it) throws IOException {
        String ll = label + "IppImageAnchorS3File Array, length: ";
        tf.write(ll);
        if (it == null) {
            tf.write("NULL!!!\n");
            return;
        }
        tf.write("" + it.length + "\n");
        for (int i = 0; i < it.length; ++i) {
            ll = label + "IppImageAnchorS3File[" + String.valueOf(i) + "]: ";
            IppImageAnchorS3File.Print(tf, ll, it[i]);
        }
    }

    public void adjustVarPos(Offset varPos) {
        try {
            varPos.val += this.value_.getBytes("UTF-8").length + 1;
        }
        catch (UnsupportedEncodingException e) {
            throw new AssertionError(e);
        }
    }

    public int type() {
        return 65547;
    }

    public String value() {
        return this.value_;
    }
}