package com.suse.salt.netapi.results;

import com.google.gson.annotations.SerializedName;

/**
 * Result structure as returned by state.apply to be parsed from event data.
 *
 * @param <R> the parameterized type of the changes
 */
public class StateApplyResult<R> {

    private String comment;
    private String name;
    @SerializedName("start_time")
    private String startTime;
    private boolean result;
    private double duration;
    @SerializedName("__run_num__")
    private int runNum;
    protected R changes;

    public String getComment() {
        return comment;
    }

    public String getName() {
        return name;
    }

    public String getStartTime() {
        return startTime;
    }

    public boolean isResult() {
        return result;
    }

    public double getDuration() {
        return duration;
    }

    public int getRunNum() {
        return runNum;
    }

    public R getChanges() {
        return changes;
    }
}

@@ -82,16 +82,83 @@
 zedName;
+%0Aimport com.suse.salt.netapi.utils.Xor;%0A%0Aimport java.util.Optional;
 %0A%0A/**%0A *
@@ -371,19 +371,63 @@
 ate 
-String name
+Optional%3CXor%3CString%5B%5D, String%3E%3E name = Optional.empty()
 ;%0A  
@@ -701,30 +701,55 @@
 %0A    public 
-String
+Optional%3CXor%3CString%5B%5D, String%3E%3E
  getName() %7B

handle array of names and null