return mMissingVolumeRecord.getNickname();
    }

package com.android.settings.deviceinfo.storage;

import android.annotation.NonNull;
import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.storage.DiskInfo;
import android.os.storage.StorageManager;
import android.os.storage.VolumeInfo;
import android.os.storage.VolumeRecord;
import android.text.TextUtils;
import com.android.settings.R;
import java.io.File;

/**
 * This object contains a {@link VolumeInfo} for a mountable storage or a {@link DiskInfo} for an
 * unsupported disk which is not able to be mounted automatically.
 */
public class StorageEntry implements Comparable<StorageEntry>, Parcelable {

    private final VolumeInfo mVolumeInfo;

    private final DiskInfo mUnsupportedDiskInfo;

    private final VolumeRecord mMissingVolumeRecord;

    private final String mVolumeInfoDescription;

    public StorageEntry(@NonNull Context context, @NonNull VolumeInfo volumeInfo) {
        mVolumeInfo = volumeInfo;
        mUnsupportedDiskInfo = null;
        mMissingVolumeRecord = null;
        if (isDefaultInternalStorage()) {
            mVolumeInfoDescription = context.getResources().getString(R.string.storage_default_internal_storage);
        } else {
            mVolumeInfoDescription = context.getSystemService(StorageManager.class).getBestVolumeDescription(mVolumeInfo);
        }
    }

    public StorageEntry(@NonNull DiskInfo diskInfo) {
        mVolumeInfo = null;
        mUnsupportedDiskInfo = diskInfo;
        mMissingVolumeRecord = null;
        mVolumeInfoDescription = null;
    }

    public StorageEntry(@NonNull VolumeRecord volumeRecord) {
        mVolumeInfo = null;
        mUnsupportedDiskInfo = null;
        mMissingVolumeRecord = volumeRecord;
        mVolumeInfoDescription = null;
    }

    private StorageEntry(Parcel in) {
        mVolumeInfo = in.readParcelable(VolumeInfo.class.getClassLoader());
        mUnsupportedDiskInfo = in.readParcelable(DiskInfo.class.getClassLoader());
        mMissingVolumeRecord = in.readParcelable(VolumeRecord.class.getClassLoader());
        mVolumeInfoDescription = in.readString();
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel out, int flags) {
        out.writeParcelable(mVolumeInfo, 0);
        out.writeParcelable(mUnsupportedDiskInfo, 0);
        out.writeParcelable(mMissingVolumeRecord, 0);
        out.writeString(mVolumeInfoDescription);
    }

    public static final Parcelable.Creator<StorageEntry> CREATOR = new Parcelable.Creator<StorageEntry>() {

        public StorageEntry createFromParcel(Parcel in) {
            return new StorageEntry(in);
        }

        public StorageEntry[] newArray(int size) {
            return new StorageEntry[size];
        }
    };

    @Override
    public boolean equals(Object o) {
        if (o == this) {
            return true;
        }
        if (!(o instanceof StorageEntry)) {
            return false;
        }
        final StorageEntry StorageEntry = (StorageEntry) o;
        if (isVolumeInfo()) {
            return mVolumeInfo.equals(StorageEntry.mVolumeInfo);
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.equals(StorageEntry.mUnsupportedDiskInfo);
        }
        return mMissingVolumeRecord.equals(StorageEntry.mMissingVolumeRecord);
    }

    @Override
    public int hashCode() {
        if (isVolumeInfo()) {
            return mVolumeInfo.hashCode();
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.hashCode();
        }
        return mMissingVolumeRecord.hashCode();
    }

    @Override
    public String toString() {
        if (isVolumeInfo()) {
            return mVolumeInfo.toString();
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.toString();
        }
        return mMissingVolumeRecord.toString();
    }

    @Override
    public int compareTo(StorageEntry other) {
        if (isDefaultInternalStorage() && !other.isDefaultInternalStorage()) {
            return -1;
        }
        if (!isDefaultInternalStorage() && other.isDefaultInternalStorage()) {
            return 1;
        }
        if (isVolumeInfo() && !other.isVolumeInfo()) {
            return -1;
        }
        if (!isVolumeInfo() && other.isVolumeInfo()) {
            return 1;
        }
        if (isPrivate() && !other.isPrivate()) {
            return -1;
        }
        if (!isPrivate() && other.isPrivate()) {
            return 1;
        }
        if (isMounted() && !other.isMounted()) {
            return -1;
        }
        if (!isMounted() && other.isMounted()) {
            return 1;
        }
        if (!isVolumeRecordMissed() && other.isVolumeRecordMissed()) {
            return -1;
        }
        if (isVolumeRecordMissed() && !other.isVolumeRecordMissed()) {
            return 1;
        }
        if (getDescription() == null) {
            return 1;
        }
        if (other.getDescription() == null) {
            return -1;
        }
        return getDescription().compareTo(other.getDescription());
    }

    public static StorageEntry getDefaultInternalStorageEntry(Context context) {
        return new StorageEntry(context, context.getSystemService(StorageManager.class).findVolumeById(VolumeInfo.ID_PRIVATE_INTERNAL));
    }

    /**
     * If it's a VolumeInfo.
     */
    public boolean isVolumeInfo() {
        return mVolumeInfo != null;
    }

    /**
     * If it's an unsupported DiskInfo.
     */
    public boolean isDiskInfoUnsupported() {
        return mUnsupportedDiskInfo != null;
    }

    /**
     * If it's a missing VolumeRecord.
     */
    public boolean isVolumeRecordMissed() {
        return mMissingVolumeRecord != null;
    }

    /**
     * If it's a default internal storage.
     */
    public boolean isDefaultInternalStorage() {
        if (isVolumeInfo()) {
            return mVolumeInfo.getType() == VolumeInfo.TYPE_PRIVATE && TextUtils.equals(mVolumeInfo.getId(), VolumeInfo.ID_PRIVATE_INTERNAL);
        }
        return false;
    }

    /**
     * If it's a mounted storage.
     */
    public boolean isMounted() {
        return mVolumeInfo == null ? false : (mVolumeInfo.getState() == VolumeInfo.STATE_MOUNTED || mVolumeInfo.getState() == VolumeInfo.STATE_MOUNTED_READ_ONLY);
    }

    /**
     * If it's an unmounted storage.
     */
    public boolean isUnmounted() {
        return mVolumeInfo == null ? false : (mVolumeInfo.getState() == VolumeInfo.STATE_UNMOUNTED);
    }

    /**
     * If it's an unmountable storage.
     */
    public boolean isUnmountable() {
        return mVolumeInfo == null ? false : mVolumeInfo.getState() == VolumeInfo.STATE_UNMOUNTABLE;
    }

    /**
     * If it's a private storage.
     */
    public boolean isPrivate() {
        return mVolumeInfo == null ? false : mVolumeInfo.getType() == VolumeInfo.TYPE_PRIVATE;
    }

    /**
     * If it's a public storage.
     */
    public boolean isPublic() {
        return mVolumeInfo == null ? false : mVolumeInfo.getType() == VolumeInfo.TYPE_PUBLIC;
    }

    /**
     * Returns description.
     */
    public String getDescription() {
        if (isVolumeInfo()) {
            return mVolumeInfoDescription;
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.getDescription();
        }

    /**
     * Returns ID.
     */
    public String getId() {
        if (isVolumeInfo()) {
            return mVolumeInfo.getId();
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.getId();
        }
        return mMissingVolumeRecord.getFsUuid();
    }

    /**
     * Returns disk ID.
     */
    public String getDiskId() {
        if (isVolumeInfo()) {
            return mVolumeInfo.getDiskId();
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.getId();
        }
        return null;
    }

    /**
     * Returns fsUuid.
     */
    public String getFsUuid() {
        if (isVolumeInfo()) {
            return mVolumeInfo.getFsUuid();
        }
        if (isDiskInfoUnsupported()) {
            return null;
        }
        return mMissingVolumeRecord.getFsUuid();
    }

    /**
     * Returns root file if it's a VolumeInfo.
     */
    public File getPath() {
        return mVolumeInfo == null ? null : mVolumeInfo.getPath();
    }

    /**
     * Returns VolumeInfo of the StorageEntry.
     */
    public VolumeInfo getVolumeInfo() {
        return mVolumeInfo;
    }
}


package com.android.settings.deviceinfo.storage;

import android.annotation.NonNull;
import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.storage.DiskInfo;
import android.os.storage.StorageManager;
import android.os.storage.VolumeInfo;
import android.os.storage.VolumeRecord;
import android.text.TextUtils;
import com.android.settings.R;
import java.io.File;

/**
 * This object contains a {@link VolumeInfo} for a mountable storage or a {@link DiskInfo} for an
 * unsupported disk which is not able to be mounted automatically.
 */
public class StorageEntry implements Comparable<StorageEntry>, Parcelable {

    private final VolumeInfo mVolumeInfo;

    private final DiskInfo mUnsupportedDiskInfo;

    private final VolumeRecord mMissingVolumeRecord;

    private final String mVolumeInfoDescription;

    public StorageEntry(@NonNull Context context, @NonNull VolumeInfo volumeInfo) {
        mVolumeInfo = volumeInfo;
        mUnsupportedDiskInfo = null;
        mMissingVolumeRecord = null;
        if (isDefaultInternalStorage()) {
            mVolumeInfoDescription = context.getResources().getString(R.string.storage_default_internal_storage);
        } else {
            mVolumeInfoDescription = context.getSystemService(StorageManager.class).getBestVolumeDescription(mVolumeInfo);
        }
    }

    public StorageEntry(@NonNull DiskInfo diskInfo) {
        mVolumeInfo = null;
        mUnsupportedDiskInfo = diskInfo;
        mMissingVolumeRecord = null;
        mVolumeInfoDescription = null;
    }

    public StorageEntry(@NonNull VolumeRecord volumeRecord) {
        mVolumeInfo = null;
        mUnsupportedDiskInfo = null;
        mMissingVolumeRecord = volumeRecord;
        mVolumeInfoDescription = null;
    }

    private StorageEntry(Parcel in) {
        mVolumeInfo = in.readParcelable(VolumeInfo.class.getClassLoader());
        mUnsupportedDiskInfo = in.readParcelable(DiskInfo.class.getClassLoader());
        mMissingVolumeRecord = in.readParcelable(VolumeRecord.class.getClassLoader());
        mVolumeInfoDescription = in.readString();
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel out, int flags) {
        out.writeParcelable(mVolumeInfo, 0);
        out.writeParcelable(mUnsupportedDiskInfo, 0);
        out.writeParcelable(mMissingVolumeRecord, 0);
        out.writeString(mVolumeInfoDescription);
    }

    public static final Parcelable.Creator<StorageEntry> CREATOR = new Parcelable.Creator<StorageEntry>() {

        public StorageEntry createFromParcel(Parcel in) {
            return new StorageEntry(in);
        }

        public StorageEntry[] newArray(int size) {
            return new StorageEntry[size];
        }
    };

    @Override
    public boolean equals(Object o) {
        if (o == this) {
            return true;
        }
        if (!(o instanceof StorageEntry)) {
            return false;
        }
        final StorageEntry StorageEntry = (StorageEntry) o;
        if (isVolumeInfo()) {
            return mVolumeInfo.equals(StorageEntry.mVolumeInfo);
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.equals(StorageEntry.mUnsupportedDiskInfo);
        }
        return mMissingVolumeRecord.equals(StorageEntry.mMissingVolumeRecord);
    }

    @Override
    public int hashCode() {
        if (isVolumeInfo()) {
            return mVolumeInfo.hashCode();
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.hashCode();
        }
        return mMissingVolumeRecord.hashCode();
    }

    @Override
    public String toString() {
        if (isVolumeInfo()) {
            return mVolumeInfo.toString();
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.toString();
        }
        return mMissingVolumeRecord.toString();
    }

    @Override
    public int compareTo(StorageEntry other) {
        if (isDefaultInternalStorage() && !other.isDefaultInternalStorage()) {
            return -1;
        }
        if (!isDefaultInternalStorage() && other.isDefaultInternalStorage()) {
            return 1;
        }
        if (isVolumeInfo() && !other.isVolumeInfo()) {
            return -1;
        }
        if (!isVolumeInfo() && other.isVolumeInfo()) {
            return 1;
        }
        if (isPrivate() && !other.isPrivate()) {
            return -1;
        }
        if (!isPrivate() && other.isPrivate()) {
            return 1;
        }
        if (isMounted() && !other.isMounted()) {
            return -1;
        }
        if (!isMounted() && other.isMounted()) {
            return 1;
        }
        if (!isVolumeRecordMissed() && other.isVolumeRecordMissed()) {
            return -1;
        }
        if (isVolumeRecordMissed() && !other.isVolumeRecordMissed()) {
            return 1;
        }
        if (getDescription() == null) {
            return 1;
        }
        if (other.getDescription() == null) {
            return -1;
        }
        return getDescription().compareTo(other.getDescription());
    }

    public static StorageEntry getDefaultInternalStorageEntry(Context context) {
        return new StorageEntry(context, context.getSystemService(StorageManager.class).findVolumeById(VolumeInfo.ID_PRIVATE_INTERNAL));
    }

    /**
     * If it's a VolumeInfo.
     */
    public boolean isVolumeInfo() {
        return mVolumeInfo != null;
    }

    /**
     * If it's an unsupported DiskInfo.
     */
    public boolean isDiskInfoUnsupported() {
        return mUnsupportedDiskInfo != null;
    }

    /**
     * If it's a missing VolumeRecord.
     */
    public boolean isVolumeRecordMissed() {
        return mMissingVolumeRecord != null;
    }

    /**
     * If it's a default internal storage.
     */
    public boolean isDefaultInternalStorage() {
        if (isVolumeInfo()) {
            return mVolumeInfo.getType() == VolumeInfo.TYPE_PRIVATE && TextUtils.equals(mVolumeInfo.getId(), VolumeInfo.ID_PRIVATE_INTERNAL);
        }
        return false;
    }

    /**
     * If it's a mounted storage.
     */
    public boolean isMounted() {
        return mVolumeInfo == null ? false : (mVolumeInfo.getState() == VolumeInfo.STATE_MOUNTED || mVolumeInfo.getState() == VolumeInfo.STATE_MOUNTED_READ_ONLY);
    }

    /**
     * If it's an unmounted storage.
     */
    public boolean isUnmounted() {
        return mVolumeInfo == null ? false : (mVolumeInfo.getState() == VolumeInfo.STATE_UNMOUNTED);
    }

    /**
     * If it's an unmountable storage.
     */
    public boolean isUnmountable() {
        return mVolumeInfo == null ? false : mVolumeInfo.getState() == VolumeInfo.STATE_UNMOUNTABLE;
    }

    /**
     * If it's a private storage.
     */
    public boolean isPrivate() {
        return mVolumeInfo == null ? false : mVolumeInfo.getType() == VolumeInfo.TYPE_PRIVATE;
    }

    /**
     * If it's a public storage.
     */
    public boolean isPublic() {
        return mVolumeInfo == null ? false : mVolumeInfo.getType() == VolumeInfo.TYPE_PUBLIC;
    }

    /**
     * Returns description.
     */
    public String getDescription() {
        if (isVolumeInfo()) {
            return mVolumeInfoDescription;
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.getDescription();
        }
        return mMissingVolumeRecord.getNickname();
    }

    /**
     * Returns ID.
     */
    public String getId() {
        if (isVolumeInfo()) {
            return mVolumeInfo.getId();
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.getId();
        }
        return mMissingVolumeRecord.getFsUuid();
    }

    /**
     * Returns disk ID.
     */
    public String getDiskId() {
        if (isVolumeInfo()) {
            return mVolumeInfo.getDiskId();
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.getId();
        }
        return nul

    }

    /**
     * Returns fsUuid.
     */
    public String getFsUuid() {
        if (isVolumeInfo()) {
            return mVolumeInfo.getFsUuid();
        }
        if (isDiskInfoUnsupported()) {
            return null;
        }
        return mMissingVolumeRecord.getFsUuid();
    }

    /**
     * Returns root file if it's a VolumeInfo.
     */
    public File getPath() {
        return mVolumeInfo == null ? null : mVolumeInfo.getPath();
    }

    /**
     * Returns VolumeInfo of the StorageEntry.
     */
    public VolumeInfo getVolumeInfo() {
        return mVolumeInfo;
    }
}


public String getFsUuid() {
        if (isVolumeInfo()) {
            return mVolumeInfo.getFsUuid();
        }
        if (isDiskInfoUnsupported()) {
            return null;
        }
        return mMissingVolumeRecord.getFsUuid();
    }

package com.android.settings.deviceinfo.storage;

import android.annotation.NonNull;
import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.storage.DiskInfo;
import android.os.storage.StorageManager;
import android.os.storage.VolumeInfo;
import android.os.storage.VolumeRecord;
import android.text.TextUtils;
import com.android.settings.R;
import java.io.File;

/**
 * This object contains a {@link VolumeInfo} for a mountable storage or a {@link DiskInfo} for an
 * unsupported disk which is not able to be mounted automatically.
 */
public class StorageEntry implements Comparable<StorageEntry>, Parcelable {

    private final VolumeInfo mVolumeInfo;

    private final DiskInfo mUnsupportedDiskInfo;

    private final VolumeRecord mMissingVolumeRecord;

    private final String mVolumeInfoDescription;

    public StorageEntry(@NonNull Context context, @NonNull VolumeInfo volumeInfo) {
        mVolumeInfo = volumeInfo;
        mUnsupportedDiskInfo = null;
        mMissingVolumeRecord = null;
        if (isDefaultInternalStorage()) {
            mVolumeInfoDescription = context.getResources().getString(R.string.storage_default_internal_storage);
        } else {
            mVolumeInfoDescription = context.getSystemService(StorageManager.class).getBestVolumeDescription(mVolumeInfo);
        }
    }

    public StorageEntry(@NonNull DiskInfo diskInfo) {
        mVolumeInfo = null;
        mUnsupportedDiskInfo = diskInfo;
        mMissingVolumeRecord = null;
        mVolumeInfoDescription = null;
    }

    public StorageEntry(@NonNull VolumeRecord volumeRecord) {
        mVolumeInfo = null;
        mUnsupportedDiskInfo = null;
        mMissingVolumeRecord = volumeRecord;
        mVolumeInfoDescription = null;
    }

    private StorageEntry(Parcel in) {
        mVolumeInfo = in.readParcelable(VolumeInfo.class.getClassLoader());
        mUnsupportedDiskInfo = in.readParcelable(DiskInfo.class.getClassLoader());
        mMissingVolumeRecord = in.readParcelable(VolumeRecord.class.getClassLoader());
        mVolumeInfoDescription = in.readString();
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel out, int flags) {
        out.writeParcelable(mVolumeInfo, 0);
        out.writeParcelable(mUnsupportedDiskInfo, 0);
        out.writeParcelable(mMissingVolumeRecord, 0);
        out.writeString(mVolumeInfoDescription);
    }

    public static final Parcelable.Creator<StorageEntry> CREATOR = new Parcelable.Creator<StorageEntry>() {

        public StorageEntry createFromParcel(Parcel in) {
            return new StorageEntry(in);
        }

        public StorageEntry[] newArray(int size) {
            return new StorageEntry[size];
        }
    };

    @Override
    public boolean equals(Object o) {
        if (o == this) {
            return true;
        }
        if (!(o instanceof StorageEntry)) {
            return false;
        }
        final StorageEntry StorageEntry = (StorageEntry) o;
        if (isVolumeInfo()) {
            return mVolumeInfo.equals(StorageEntry.mVolumeInfo);
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.equals(StorageEntry.mUnsupportedDiskInfo);
        }
        return mMissingVolumeRecord.equals(StorageEntry.mMissingVolumeRecord);
    }

    @Override
    public int hashCode() {
        if (isVolumeInfo()) {
            return mVolumeInfo.hashCode();
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.hashCode();
        }
        return mMissingVolumeRecord.hashCode();
    }

    @Override
    public String toString() {
        if (isVolumeInfo()) {
            return mVolumeInfo.toString();
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.toString();
        }
        return mMissingVolumeRecord.toString();
    }

    @Override
    public int compareTo(StorageEntry other) {
        if (isDefaultInternalStorage() && !other.isDefaultInternalStorage()) {
            return -1;
        }
        if (!isDefaultInternalStorage() && other.isDefaultInternalStorage()) {
            return 1;
        }
        if (isVolumeInfo() && !other.isVolumeInfo()) {
            return -1;
        }
        if (!isVolumeInfo() && other.isVolumeInfo()) {
            return 1;
        }
        if (isPrivate() && !other.isPrivate()) {
            return -1;
        }
        if (!isPrivate() && other.isPrivate()) {
            return 1;
        }
        if (isMounted() && !other.isMounted()) {
            return -1;
        }
        if (!isMounted() && other.isMounted()) {
            return 1;
        }
        if (!isVolumeRecordMissed() && other.isVolumeRecordMissed()) {
            return -1;
        }
        if (isVolumeRecordMissed() && !other.isVolumeRecordMissed()) {
            return 1;
        }
        if (getDescription() == null) {
            return 1;
        }
        if (other.getDescription() == null) {
            return -1;
        }
        return getDescription().compareTo(other.getDescription());
    }

    public static StorageEntry getDefaultInternalStorageEntry(Context context) {
        return new StorageEntry(context, context.getSystemService(StorageManager.class).findVolumeById(VolumeInfo.ID_PRIVATE_INTERNAL));
    }

    /**
     * If it's a VolumeInfo.
     */
    public boolean isVolumeInfo() {
        return mVolumeInfo != null;
    }

    /**
     * If it's an unsupported DiskInfo.
     */
    public boolean isDiskInfoUnsupported() {
        return mUnsupportedDiskInfo != null;
    }

    /**
     * If it's a missing VolumeRecord.
     */
    public boolean isVolumeRecordMissed() {
        return mMissingVolumeRecord != null;
    }

    /**
     * If it's a default internal storage.
     */
    public boolean isDefaultInternalStorage() {
        if (isVolumeInfo()) {
            return mVolumeInfo.getType() == VolumeInfo.TYPE_PRIVATE && TextUtils.equals(mVolumeInfo.getId(), VolumeInfo.ID_PRIVATE_INTERNAL);
        }
        return false;
    }

    /**
     * If it's a mounted storage.
     */
    public boolean isMounted() {
        return mVolumeInfo == null ? false : (mVolumeInfo.getState() == VolumeInfo.STATE_MOUNTED || mVolumeInfo.getState() == VolumeInfo.STATE_MOUNTED_READ_ONLY);
    }

    /**
     * If it's an unmounted storage.
     */
    public boolean isUnmounted() {
        return mVolumeInfo == null ? false : (mVolumeInfo.getState() == VolumeInfo.STATE_UNMOUNTED);
    }

    /**
     * If it's an unmountable storage.
     */
    public boolean isUnmountable() {
        return mVolumeInfo == null ? false : mVolumeInfo.getState() == VolumeInfo.STATE_UNMOUNTABLE;
    }

    /**
     * If it's a private storage.
     */
    public boolean isPrivate() {
        return mVolumeInfo == null ? false : mVolumeInfo.getType() == VolumeInfo.TYPE_PRIVATE;
    }

    /**
     * If it's a public storage.
     */
    public boolean isPublic() {
        return mVolumeInfo == null ? false : mVolumeInfo.getType() == VolumeInfo.TYPE_PUBLIC;
    }

    /**
     * Returns description.
     */
    public String getDescription() {
        if (isVolumeInfo()) {
            return mVolumeInfoDescription;
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.getDescription();
        }
        return mMissingVolumeRecord.getNickname();
    }

    /**
     * Returns ID.
     */
    public String getId() {
        if (isVolumeInfo()) {
            return mVolumeInfo.getId();
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.getId();
        }
        return mMissingVolumeRecord.getFsUuid();
    }

    /**
     * Returns disk ID.
     */
    public String getDiskId() {
        if (isVolumeInfo()) {
            return mVolumeInfo.getDiskId();
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.getId();
        }
        return null;
    }

    /**
     * Returns fsUuid.
     */

    /**
     * Returns root file if it's a VolumeInfo.
     */
    public File getPath() {
        return mVolumeInfo == null ? null : mVolumeInfo.getPath();
    }

    /**
     * Returns VolumeInfo of the StorageEntry.
     */
    public VolumeInfo getVolumeInfo() {
        return mVolumeInfo;
    }
}


if (isVolumeInfo()) {
            return mVolumeInfo.hashCode();
        }

package com.android.settings.deviceinfo.storage;

import android.annotation.NonNull;
import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.storage.DiskInfo;
import android.os.storage.StorageManager;
import android.os.storage.VolumeInfo;
import android.os.storage.VolumeRecord;
import android.text.TextUtils;
import com.android.settings.R;
import java.io.File;

/**
 * This object contains a {@link VolumeInfo} for a mountable storage or a {@link DiskInfo} for an
 * unsupported disk which is not able to be mounted automatically.
 */
public class StorageEntry implements Comparable<StorageEntry>, Parcelable {

    private final VolumeInfo mVolumeInfo;

    private final DiskInfo mUnsupportedDiskInfo;

    private final VolumeRecord mMissingVolumeRecord;

    private final String mVolumeInfoDescription;

    public StorageEntry(@NonNull Context context, @NonNull VolumeInfo volumeInfo) {
        mVolumeInfo = volumeInfo;
        mUnsupportedDiskInfo = null;
        mMissingVolumeRecord = null;
        if (isDefaultInternalStorage()) {
            mVolumeInfoDescription = context.getResources().getString(R.string.storage_default_internal_storage);
        } else {
            mVolumeInfoDescription = context.getSystemService(StorageManager.class).getBestVolumeDescription(mVolumeInfo);
        }
    }

    public StorageEntry(@NonNull DiskInfo diskInfo) {
        mVolumeInfo = null;
        mUnsupportedDiskInfo = diskInfo;
        mMissingVolumeRecord = null;
        mVolumeInfoDescription = null;
    }

    public StorageEntry(@NonNull VolumeRecord volumeRecord) {
        mVolumeInfo = null;
        mUnsupportedDiskInfo = null;
        mMissingVolumeRecord = volumeRecord;
        mVolumeInfoDescription = null;
    }

    private StorageEntry(Parcel in) {
        mVolumeInfo = in.readParcelable(VolumeInfo.class.getClassLoader());
        mUnsupportedDiskInfo = in.readParcelable(DiskInfo.class.getClassLoader());
        mMissingVolumeRecord = in.readParcelable(VolumeRecord.class.getClassLoader());
        mVolumeInfoDescription = in.readString();
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel out, int flags) {
        out.writeParcelable(mVolumeInfo, 0);
        out.writeParcelable(mUnsupportedDiskInfo, 0);
        out.writeParcelable(mMissingVolumeRecord, 0);
        out.writeString(mVolumeInfoDescription);
    }

    public static final Parcelable.Creator<StorageEntry> CREATOR = new Parcelable.Creator<StorageEntry>() {

        public StorageEntry createFromParcel(Parcel in) {
            return new StorageEntry(in);
        }

        public StorageEntry[] newArray(int size) {
            return new StorageEntry[size];
        }
    };

    @Override
    public boolean equals(Object o) {
        if (o == this) {
            return true;
        }
        if (!(o instanceof StorageEntry)) {
            return false;
        }
        final StorageEntry StorageEntry = (StorageEntry) o;
        if (isVolumeInfo()) {
            return mVolumeInfo.equals(StorageEntry.mVolumeInfo);
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.equals(StorageEntry.mUnsupportedDiskInfo);
        }
        return mMissingVolumeRecord.equals(StorageEntry.mMissingVolumeRecord);
    }

    @Override
    public int hashCode() {

        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.hashCode();
        }
        return mMissingVolumeRecord.hashCode();
    }

    @Override
    public String toString() {
        if (isVolumeInfo()) {
            return mVolumeInfo.toString();
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.toString();
        }
        return mMissingVolumeRecord.toString();
    }

    @Override
    public int compareTo(StorageEntry other) {
        if (isDefaultInternalStorage() && !other.isDefaultInternalStorage()) {
            return -1;
        }
        if (!isDefaultInternalStorage() && other.isDefaultInternalStorage()) {
            return 1;
        }
        if (isVolumeInfo() && !other.isVolumeInfo()) {
            return -1;
        }
        if (!isVolumeInfo() && other.isVolumeInfo()) {
            return 1;
        }
        if (isPrivate() && !other.isPrivate()) {
            return -1;
        }
        if (!isPrivate() && other.isPrivate()) {
            return 1;
        }
        if (isMounted() && !other.isMounted()) {
            return -1;
        }
        if (!isMounted() && other.isMounted()) {
            return 1;
        }
        if (!isVolumeRecordMissed() && other.isVolumeRecordMissed()) {
            return -1;
        }
        if (isVolumeRecordMissed() && !other.isVolumeRecordMissed()) {
            return 1;
        }
        if (getDescription() == null) {
            return 1;
        }
        if (other.getDescription() == null) {
            return -1;
        }
        return getDescription().compareTo(other.getDescription());
    }

    public static StorageEntry getDefaultInternalStorageEntry(Context context) {
        return new StorageEntry(context, context.getSystemService(StorageManager.class).findVolumeById(VolumeInfo.ID_PRIVATE_INTERNAL));
    }

    /**
     * If it's a VolumeInfo.
     */
    public boolean isVolumeInfo() {
        return mVolumeInfo != null;
    }

    /**
     * If it's an unsupported DiskInfo.
     */
    public boolean isDiskInfoUnsupported() {
        return mUnsupportedDiskInfo != null;
    }

    /**
     * If it's a missing VolumeRecord.
     */
    public boolean isVolumeRecordMissed() {
        return mMissingVolumeRecord != null;
    }

    /**
     * If it's a default internal storage.
     */
    public boolean isDefaultInternalStorage() {
        if (isVolumeInfo()) {
            return mVolumeInfo.getType() == VolumeInfo.TYPE_PRIVATE && TextUtils.equals(mVolumeInfo.getId(), VolumeInfo.ID_PRIVATE_INTERNAL);
        }
        return false;
    }

    /**
     * If it's a mounted storage.
     */
    public boolean isMounted() {
        return mVolumeInfo == null ? false : (mVolumeInfo.getState() == VolumeInfo.STATE_MOUNTED || mVolumeInfo.getState() == VolumeInfo.STATE_MOUNTED_READ_ONLY);
    }

    /**
     * If it's an unmounted storage.
     */
    public boolean isUnmounted() {
        return mVolumeInfo == null ? false : (mVolumeInfo.getState() == VolumeInfo.STATE_UNMOUNTED);
    }

    /**
     * If it's an unmountable storage.
     */
    public boolean isUnmountable() {
        return mVolumeInfo == null ? false : mVolumeInfo.getState() == VolumeInfo.STATE_UNMOUNTABLE;
    }

    /**
     * If it's a private storage.
     */
    public boolean isPrivate() {
        return mVolumeInfo == null ? false : mVolumeInfo.getType() == VolumeInfo.TYPE_PRIVATE;
    }

    /**
     * If it's a public storage.
     */
    public boolean isPublic() {
        return mVolumeInfo == null ? false : mVolumeInfo.getType() == VolumeInfo.TYPE_PUBLIC;
    }

    /**
     * Returns description.
     */
    public String getDescription() {
        if (isVolumeInfo()) {
            return mVolumeInfoDescription;
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.getDescription();
        }
        return mMissingVolumeRecord.getNickname();
    }

    /**
     * Returns ID.
     */
    public String getId() {
        if (isVolumeInfo()) {
            return mVolumeInfo.getId();
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.getId();
        }
        return mMissingVolumeRecord.getFsUuid();
    }

    /**
     * Returns disk ID.
     */
    public String getDiskId() {
        if (isVolumeInfo()) {
            return mVolumeInfo.getDiskId();
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.getId();
        }
        return null;
    }

    /**
     * Returns fsUuid.
     */
    public String getFsUuid() {
        if (isVolumeInfo()) {
            return mVolumeInfo.getFsUuid();
        }
        if (isDiskInfoUnsupported()) {
            return null;
        }
        return mMissingVolumeRecord.getFsUuid();
    }

    /**
     * Returns root file if it's a VolumeInfo.
     */
    public File getPath() {
        return mVolumeInfo == null ? null : mVolumeInfo.getPath();
    }

    /**
     * Returns VolumeInfo of the StorageEntry.
     */
    public VolumeInfo getVolumeInfo() {
        return mVolumeInfo;
    }
}


package com.android.settings.deviceinfo.storage;

import android.annotation.NonNull;
import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.storage.DiskInfo;
import android.os.storage.StorageManager;
import android.os.storage.VolumeInfo;
import android.os.storage.VolumeRecord;
import android.text.TextUtils;
import com.android.settings.R;
import java.io.File;

/**
 * This object contains a {@link VolumeInfo} for a mountable storage or a {@link DiskInfo} for an
 * unsupported disk which is not able to be mounted automatically.
 */
public class StorageEntry implements Comparable<StorageEntry>, Parcelable {

    private final VolumeInfo mVolumeInfo;

    private final DiskInfo mUnsupportedDiskInfo;

    private final VolumeRecord mMissingVolumeRecord;

    private final String mVolumeInfoDescription;

    public StorageEntry(@NonNull Context context, @NonNull VolumeInfo volumeInfo) {
        mVolumeInfo = volumeInfo;
        mUnsupportedDiskInfo = null;
        mMissingVolumeRecord = null;
        if (isDefaultInternalStorage()) {
            mVolumeInfoDescription = context.getResources().getString(R.string.storage_default_internal_storage);
        } else {
            mVolumeInfoDescription = context.getSystemService(StorageManager.class).getBestVolumeDescription(mVolumeInfo);
        }
    }

    public StorageEntry(@NonNull DiskInfo diskInfo) {
        mVolumeInfo = null;
        mUnsupportedDiskInfo = diskInfo;
        mMissingVolumeRecord = null;
        mVolumeInfoDescription = null;
    }

    public StorageEntry(@NonNull VolumeRecord volumeRecord) {
        mVolumeInfo = null;
        mUnsupportedDiskInfo = null;
        mMissingVolumeRecord = volumeRecord;
        mVolumeInfoDescription = null;
    }

    private StorageEntry(Parcel in) {
        mVolumeInfo = in.readParcelable(VolumeInfo.class.getClassLoader());
        mUnsupportedDiskInfo = in.readParcelable(DiskInfo.class.getClassLoader());
        mMissingVolumeRecord = in.readParcelable(VolumeRecord.class.getClassLoader());
        mVolumeInfoDescription = in.readString();
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel out, int flags) {
        out.writeParcelable(mVolumeInfo, 0);
        out.writeParcelable(mUnsupportedDiskInfo, 0);
        out.writeParcelable(mMissingVolumeRecord, 0);
        out.writeString(mVolumeInfoDescription);
    }

    public static final Parcelable.Creator<StorageEntry> CREATOR = new Parcelable.Creator<StorageEntry>() {

        public StorageEntry createFromParcel(Parcel in) {
            return new StorageEntry(in);
        }

        public StorageEntry[] newArray(int size) {
            return new StorageEntry[size];
        }
    };

    @Override
    public boolean equals(Object o) {
        if (o == this) {
            return true;
        }
        if (!(o instanceof StorageEntry)) {
            return false;
        }
        final StorageEntry StorageEntry = (StorageEntry) o;
        if (isVolumeInfo()) {
            return mVolumeInfo.equals(StorageEntry.mVolumeInfo);
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.equals(StorageEntry.mUnsupportedDiskInfo);
        }
        return mMissingVolumeRecord.equals(StorageEntry.mMissingVolumeRecord);
    }

    @Override
    public int hashCode() {
        if (isVolumeInfo()) {
            return mVolumeInfo.hashCode();
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.hashCode();
        }
        return mMissingVolumeRecord.hashCode();
    }

    @Override
    public String toString() {
        if (isVolumeInfo()) {
            return mVolumeInfo.toString();
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.toString();
        }
        return mMissingVolumeRecord.toString();
    }

    @Override
    public int compareTo(StorageEntry other) {
        if (isDefaultInternalStorage() && !other.isDefaultInternalStorage()) {
            return -1;
        }
        if (!isDefaultInternalStorage() && other.isDefaultInternalStorage()) {
            return 1;
        }
        if (isVolumeInfo() && !other.isVolumeInfo()) {
            return -1;
        }
        if (!isVolumeInfo() && other.isVolumeInfo()) {
            return 1;
        }
        if (isPrivate() && !other.isPrivate()) {
            return -1;
        }
        if (!isPrivate() && other.isPrivate()) {
            return 1;

   }
        if (isMounted() && !other.isMounted()) {
            return -1;
        }
        if (!isMounted() && other.isMounted()) {
            return 1;
        }
        if (!isVolumeRecordMissed() && other.isVolumeRecordMissed()) {
            return -1;
        }
        if (isVolumeRecordMissed() && !other.isVolumeRecordMissed()) {
            return 1;
        }
        if (getDescription() == null) {
            return 1;
        }
        if (other.getDescription() == null) {
            return -1;
        }
        return getDescription().compareTo(other.getDescription());
    }

    public static StorageEntry getDefaultInternalStorageEntry(Context context) {
        return new StorageEntry(context, context.getSystemService(StorageManager.class).findVolumeById(VolumeInfo.ID_PRIVATE_INTERNAL));
    }

    /**
     * If it's a VolumeInfo.
     */
    public boolean isVolumeInfo() {
        return mVolumeInfo != null;
    }

    /**
     * If it's an unsupported DiskInfo.
     */
    public boolean isDiskInfoUnsupported() {
        return mUnsupportedDiskInfo != null;
    }

    /**
     * If it's a missing VolumeRecord.
     */
    public boolean isVolumeRecordMissed() {
        return mMissingVolumeRecord != null;
    }

    /**
     * If it's a default internal storage.
     */
    public boolean isDefaultInternalStorage() {
        if (isVolumeInfo()) {
            return mVolumeInfo.getType() == VolumeInfo.TYPE_PRIVATE && TextUtils.equals(mVolumeInfo.getId(), VolumeInfo.ID_PRIVATE_INTERNAL);
        }
        return false;
    }

    /**
     * If it's a mounted storage.
     */
    public boolean isMounted() {
        return mVolumeInfo == null ? false : (mVolumeInfo.getState() == VolumeInfo.STATE_MOUNTED || mVolumeInfo.getState() == VolumeInfo.STATE_MOUNTED_READ_ONLY);
    }

    /**
     * If it's an unmounted storage.
     */
    public boolean isUnmounted() {
        return mVolumeInfo == null ? false : (mVolumeInfo.getState() == VolumeInfo.STATE_UNMOUNTED);
    }

    /**
     * If it's an unmountable storage.
     */
    public boolean isUnmountable() {
        return mVolumeInfo == null ? false : mVolumeInfo.getState() == VolumeInfo.STATE_UNMOUNTABLE;
    }

    /**
     * If it's a private storage.
     */
    public boolean isPrivate() {
        return mVolumeInfo == null ? false : mVolumeInfo.getType() == VolumeInfo.TYPE_PRIVATE;
    }

    /**
     * If it's a public storage.
     */
    public boolean isPublic() {
        return mVolumeInfo == null ? false : mVolumeInfo.getType() == VolumeInfo.TYPE_PUBLIC;
    }

    /**
     * Returns description.
     */
    public String getDescription() {
        if (isVolumeInfo()) {
            return mVolumeInfoDescription;
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.getDescription();
        }
        return mMissingVolumeRecord.getNickname();
    }

    /**
     * Returns ID.
     */
    public String getId() {
        if (isVolumeInfo()) {
            return mVolumeInfo.getId();
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.getId();
        }
        return mMissingVolumeRecord.getFsUuid();
    }

    /**
     * Returns disk ID.
     */
    public String getDiskId() {
        if (isVolumeInfo()) {
            return mVolumeInfo.getDiskId();
        }
        if (isDiskInfoUnsupported()) {
            return mUnsupportedDiskInfo.getId();
        }
        return null;
    }

    /**
     * Returns fsUuid.
     */
    public String getFsUuid() {
        if (isVolumeInfo()) {
            return mVolumeInfo.getFsUuid();
        }
        if (isDiskInfoUnsupported()) {
            return null;
        }
        return mMissingVolumeRecord.getFsUuid();
    }

    /**
     * Returns root file if it's a VolumeInfo.
     */
    public File getPath() {
        return mVolumeInfo == null ? null : mVolumeInfo.getPath();
    }

    /**
     * Returns VolumeInfo of the StorageEntry.
     */
    public VolumeInfo getVolumeInfo() {
        return mVolumeInfo;
    }
}


@Override
    protected SPageNode getContent()

package org.openlowcode.module.system.page;

import org.openlowcode.module.system.action.SessioncleaningAction;
import org.openlowcode.module.system.action.generated.AtgLaunchsearchusersessionAction;
import org.openlowcode.module.system.page.generated.AbsSessioncleaningPage;
import org.openlowcode.server.graphic.SPageNode;
import org.openlowcode.server.graphic.widget.SActionButton;
import org.openlowcode.server.graphic.widget.SComponentBand;
import org.openlowcode.server.graphic.widget.SIntegerField;
import org.openlowcode.server.graphic.widget.SPageText;

/**
 * Page to perform session cleaning
 *
 * @author Open Lowcode
 *         SAS
 */
public class SessioncleaningPage extends AbsSessioncleaningPage {

    /**
     * create the page
     *
     * @param numberofitems
     * @param oldestlog
     */
    public SessioncleaningPage(Integer numberofitems, Integer oldestlog) {
        super(numberofitems, oldestlog);
    }

    @Override
    public String generateTitle(Integer numberofitems, Integer oldestlog) {
        return "Clean Sessions";
    }

{
        SComponentBand mainband = new SComponentBand(SComponentBand.DIRECTION_DOWN, this);
        mainband.addElement(new SPageText("Session Log cleaning", SPageText.TYPE_TITLE, this));
        SIntegerField numberofrecords = new SIntegerField("Number of records", "RECORDS", "", this.getNumberofitems(), false, this, true, false, false, null);
        mainband.addElement(numberofrecords);
        SIntegerField oldestlog = new SIntegerField("Oldest log (days)", "OLDESTLOGS", "", this.getOldestlog(), false, this, true, false, false, null);
        mainband.addElement(oldestlog);
        SessioncleaningAction.ActionRef sessioncleaningaction = SessioncleaningAction.get().getActionRef();
        SIntegerField keepdays = new SIntegerField("Keep days of history", "KEEPDAYS", "", new Integer(31), false, this, false, false, false, sessioncleaningaction);
        mainband.addElement(keepdays);
        sessioncleaningaction.setCleansessionsolderthandays(keepdays.getIntegerInput());
        SActionButton clean = new SActionButton("Clean older logs", sessioncleaningaction, this);
        SComponentBand buttonband = new SComponentBand(SComponentBand.DIRECTION_RIGHT, this);
        buttonband.addElement(clean);
        AtgLaunchsearchusersessionAction.ActionRef searchsessionlogs = AtgLaunchsearchusersessionAction.get().getActionRef();
        buttonband.addElement(new SActionButton("Search Session Logs", searchsessionlogs, this));
        mainband.addElement(buttonband);
        return mainband;
    }
}


{
        return "Clean Sessions";
    }

package org.openlowcode.module.system.page;

import org.openlowcode.module.system.action.SessioncleaningAction;
import org.openlowcode.module.system.action.generated.AtgLaunchsearchusersessionAction;
import org.openlowcode.module.system.page.generated.AbsSessioncleaningPage;
import org.openlowcode.server.graphic.SPageNode;
import org.openlowcode.server.graphic.widget.SActionButton;
import org.openlowcode.server.graphic.widget.SComponentBand;
import org.openlowcode.server.graphic.widget.SIntegerField;
import org.openlowcode.server.graphic.widget.SPageText;

/**
 * Page to perform session cleaning
 *
 * @author Open Lowcode
 *         SAS
 */
public class SessioncleaningPage extends AbsSessioncleaningPage {

    /**
     * create the page
     *
     * @param numberofitems
     * @param oldestlog
     */
    public SessioncleaningPage(Integer numberofitems, Integer oldestlog) {
        super(numberofitems, oldestlog);
    }

    @Override
    public String generateTitle(Integer numberofitems, Integer oldestlog)

    @Override
    protected SPageNode getContent() {
        SComponentBand mainband = new SComponentBand(SComponentBand.DIRECTION_DOWN, this);
        mainband.addElement(new SPageText("Session Log cleaning", SPageText.TYPE_TITLE, this));
        SIntegerField numberofrecords = new SIntegerField("Number of records", "RECORDS", "", this.getNumberofitems(), false, this, true, false, false, null);
        mainband.addElement(numberofrecords);
        SIntegerField oldestlog = new SIntegerField("Oldest log (days)", "OLDESTLOGS", "", this.getOldestlog(), false, this, true, false, false, null);
        mainband.addElement(oldestlog);
        SessioncleaningAction.ActionRef sessioncleaningaction = SessioncleaningAction.get().getActionRef();
        SIntegerField keepdays = new SIntegerField("Keep days of history", "KEEPDAYS", "", new Integer(31), false, this, false, false, false, sessioncleaningaction);
        mainband.addElement(keepdays);
        sessioncleaningaction.setCleansessionsolderthandays(keepdays.getIntegerInput());
        SActionButton clean = new SActionButton("Clean older logs", sessioncleaningaction, this);
        SComponentBand buttonband = new SComponentBand(SComponentBand.DIRECTION_RIGHT, this);
        buttonband.addElement(clean);
        AtgLaunchsearchusersessionAction.ActionRef searchsessionlogs = AtgLaunchsearchusersessionAction.get().getActionRef();
        buttonband.addElement(new SActionButton("Search Session Logs", searchsessionlogs, this));
        mainband.addElement(buttonband);
        return mainband;
    }
}


        SComponentBand mainband = new SComponentBand(SComponentBand.DIRECTION_DOWN, this);
        mainband.addElement(new SPageText("Session Log cleaning", SPageText.TYPE_TITLE, this));
        SIntegerField numberofrecords = new SIntegerField("Number of records", "RECORDS", "", this.getNumberofitems(), false, this, true, false, false, null);
        mainband.addElement(numberofrecords);
        SIntegerField oldestlog = new SIntegerField("Oldest log (days)", "OLDESTLOGS", "", this.getOldestlog(), false, this, true, false, false, null);
        mainband.addElement(oldestlog);

package org.openlowcode.module.system.page;

import org.openlowcode.module.system.action.SessioncleaningAction;
import org.openlowcode.module.system.action.generated.AtgLaunchsearchusersessionAction;
import org.openlowcode.module.system.page.generated.AbsSessioncleaningPage;
import org.openlowcode.server.graphic.SPageNode;
import org.openlowcode.server.graphic.widget.SActionButton;
import org.openlowcode.server.graphic.widget.SComponentBand;
import org.openlowcode.server.graphic.widget.SIntegerField;
import org.openlowcode.server.graphic.widget.SPageText;

/**
 * Page to perform session cleaning
 *
 * @author Open Lowcode
 *         SAS
 */
public class SessioncleaningPage extends AbsSessioncleaningPage {

    /**
     * create the page
     *
     * @param numberofitems
     * @param oldestlog
     */
    public SessioncleaningPage(Integer numberofitems, Integer oldestlog) {
        super(numberofitems, oldestlog);
    }

    @Override
    public String generateTitle(Integer numberofitems, Integer oldestlog) {
        return "Clean Sessions";
    }

    @Override
    protected SPageNode getContent() {

        SessioncleaningAction.ActionRef sessioncleaningaction = SessioncleaningAction.get().getActionRef();
        SIntegerField keepdays = new SIntegerField("Keep days of history", "KEEPDAYS", "", new Integer(31), false, this, false, false, false, sessioncleaningaction);
        mainband.addElement(keepdays);
        sessioncleaningaction.setCleansessionsolderthandays(keepdays.getIntegerInput());
        SActionButton clean = new SActionButton("Clean older logs", sessioncleaningaction, this);
        SComponentBand buttonband = new SComponentBand(SComponentBand.DIRECTION_RIGHT, this);
        buttonband.addElement(clean);
        AtgLaunchsearchusersessionAction.ActionRef searchsessionlogs = AtgLaunchsearchusersessionAction.get().getActionRef();
        buttonband.addElement(new SActionButton("Search Session Logs", searchsessionlogs, this));
        mainband.addElement(buttonband);
        return mainband;
    }
}


SessioncleaningAction.ActionRef sessioncleaningaction = SessioncleaningAction.get().getActionRef();
        SIntegerField keepdays = new SIntegerField("Keep days of history", "KEEPDAYS", "", new Integer(31), false, this, false, false, false, sessioncleaningaction);
        mainband.addElement(keepdays);
        sessioncleaningaction.setCleansessionsolderthandays(keepdays.getIntegerInput());
        SActionButton clean = new SActionButton("Clean older logs", sessioncleaningaction, this);
        SComponentBand buttonband = new SComponentBand(SComponentBand.DIRECTION_RIGHT, this);

package org.openlowcode.module.system.page;

import org.openlowcode.module.system.action.SessioncleaningAction;
import org.openlowcode.module.system.action.generated.AtgLaunchsearchusersessionAction;
import org.openlowcode.module.system.page.generated.AbsSessioncleaningPage;
import org.openlowcode.server.graphic.SPageNode;
import org.openlowcode.server.graphic.widget.SActionButton;
import org.openlowcode.server.graphic.widget.SComponentBand;
import org.openlowcode.server.graphic.widget.SIntegerField;
import org.openlowcode.server.graphic.widget.SPageText;

/**
 * Page to perform session cleaning
 *
 * @author Open Lowcode
 *         SAS
 */
public class SessioncleaningPage extends AbsSessioncleaningPage {

    /**
     * create the page
     *
     * @param numberofitems
     * @param oldestlog
     */
    public SessioncleaningPage(Integer numberofitems, Integer oldestlog) {
        super(numberofitems, oldestlog);
    }

    @Override
    public String generateTitle(Integer numberofitems, Integer oldestlog) {
        return "Clean Sessions";
    }

    @Override
    protected SPageNode getContent() {
        SComponentBand mainband = new SComponentBand(SComponentBand.DIRECTION_DOWN, this);
        mainband.addElement(new SPageText("Session Log cleaning", SPageText.TYPE_TITLE, this));
        SIntegerField numberofrecords = new SIntegerField("Number of records", "RECORDS", "", this.getNumberofitems(), false, this, true, false, false, null);
        mainband.addElement(numberofrecords);
        SIntegerField oldestlog = new SIntegerField("Oldest log (days)", "OLDESTLOGS", "", this.getOldestlog(), false, this, true, false, false, null);
        mainband.addElement(oldestlog);

        buttonband.addElement(clean);
        AtgLaunchsearchusersessionAction.ActionRef searchsessionlogs = AtgLaunchsearchusersessionAction.get().getActionRef();
        buttonband.addElement(new SActionButton("Search Session Logs", searchsessionlogs, this));
        mainband.addElement(buttonband);
        return mainband;
    }
}


buttonband.addElement(clean);
        AtgLaunchsearchusersessionAction.ActionRef searchsessionlogs = AtgLaunchsearchusersessionAction.get().getActionRef();
        buttonband.addElement(new SActionButton("Search Session Logs", searchsessionlogs, this));
        mainband.addElement(buttonband);
        return mainband;
    }

package org.openlowcode.module.system.page;

import org.openlowcode.module.system.action.SessioncleaningAction;
import org.openlowcode.module.system.action.generated.AtgLaunchsearchusersessionAction;
import org.openlowcode.module.system.page.generated.AbsSessioncleaningPage;
import org.openlowcode.server.graphic.SPageNode;
import org.openlowcode.server.graphic.widget.SActionButton;
import org.openlowcode.server.graphic.widget.SComponentBand;
import org.openlowcode.server.graphic.widget.SIntegerField;
import org.openlowcode.server.graphic.widget.SPageText;

/**
 * Page to perform session cleaning
 *
 * @author Open Lowcode
 *         SAS
 */
public class SessioncleaningPage extends AbsSessioncleaningPage {

    /**
     * create the page
     *
     * @param numberofitems
     * @param oldestlog
     */
    public SessioncleaningPage(Integer numberofitems, Integer oldestlog) {
        super(numberofitems, oldestlog);
    }

    @Override
    public String generateTitle(Integer numberofitems, Integer oldestlog) {
        return "Clean Sessions";
    }

    @Override
    protected SPageNode getContent() {
        SComponentBand mainband = new SComponentBand(SComponentBand.DIRECTION_DOWN, this);
        mainband.addElement(new SPageText("Session Log cleaning", SPageText.TYPE_TITLE, this));
        SIntegerField numberofrecords = new SIntegerField("Number of records", "RECORDS", "", this.getNumberofitems(), false, this, true, false, false, null);
        mainband.addElement(numberofrecords);
        SIntegerField oldestlog = new SIntegerField("Oldest log (days)", "OLDESTLOGS", "", this.getOldestlog(), false, this, true, false, false, null);
        mainband.addElement(oldestlog);
        SessioncleaningAction.ActionRef sessioncleaningaction = SessioncleaningAction.get().getActionRef();
        SIntegerField keepdays = new SIntegerField("Keep days of history", "KEEPDAYS", "", new Integer(31), false, this, false, false, false, sessioncleaningaction);
        mainband.addElement(keepdays);
        sessioncleaningaction.setCleansessionsolderthandays(keepdays.getIntegerInput());
        SActionButton clean = new SActionButton("Clean older logs", sessioncleaningaction, this);
        SComponentBand buttonband = new SComponentBand(SComponentBand.DIRECTION_RIGHT, this);


package org.openlowcode.module.system.page;

import org.openlowcode.module.system.action.SessioncleaningAction;
import org.openlowcode.module.system.action.generated.AtgLaunchsearchusersessionAction;
import org.openlowcode.module.system.page.generated.AbsSessioncleaningPage;
import org.openlowcode.server.graphic.SPageNode;
import org.openlowcode.server.graphic.widget.SActionButton;
import org.openlowcode.server.graphic.widget.SComponentBand;
import org.openlowcode.server.graphic.widget.SIntegerField;
import org.openlowcode.server.graphic.widget.SPageText;

/**
 * Page to perform session cleaning
 *
 * @author Open Lowcode
 *         SAS
 */
public class SessioncleaningPage extends AbsSessioncleaningPage {

    /**
     * create the page
     *
     * @param numberofitems
     * @param oldestlog
     */
    public SessioncleaningPage(Integer numberofitems, Integer oldestlog) {
        super(numberofitems, oldestlog);
    }

    @Override
    public String generateTitle(Integer numberofitems, Integer oldestlog) {
        retu

    }

    @Override
    protected SPageNode getContent() {
        SComponentBand mainband = new SComponentBand(SComponentBand.DIRECTION_DOWN, this);
        mainband.addElement(new SPageText("Session Log cleaning", SPageText.TYPE_TITLE, this));
        SIntegerField numberofrecords = new SIntegerField("Number of records", "RECORDS", "", this.getNumberofitems(), false, this, true, false, false, null);
        mainband.addElement(numberofrecords);
        SIntegerField oldestlog = new SIntegerField("Oldest log (days)", "OLDESTLOGS", "", this.getOldestlog(), false, this, true, false, false, null);
        mainband.addElement(oldestlog);
        SessioncleaningAction.ActionRef sessioncleaningaction = SessioncleaningAction.get().getActionRef();
        SIntegerField keepdays = new SIntegerField("Keep days of history", "KEEPDAYS", "", new Integer(31), false, this, false, false, false, sessioncleaningaction);
        mainband.addElement(keepdays);
        sessioncleaningaction.setCleansessionsolderthandays(keepdays.getIntegerInput());
        SActionButton clean = new SActionButton("Clean older logs", sessioncleaningaction, this);
        SComponentBand buttonband = new SComponentBand(SComponentBand.DIRECTION_RIGHT, this);
        buttonband.addElement(clean);
        AtgLaunchsearchusersessionAction.ActionRef searchsessionlogs = AtgLaunchsearchusersessionAction.get().getActionRef();
        buttonband.addElement(new SActionButton("Search Session Logs", searchsessionlogs, this));
        mainband.addElement(buttonband);
        return mainband;
    }
}


package org.openlowcode.module.system.page;

import org.openlowcode.module.system.action.SessioncleaningAction;
import org.openlowcode.module.system.action.generated.AtgLaunchsearchusersessionAction;
import org.openlowcode.module.system.page.generated.AbsSessioncleaningPage;
import org.openlowcode.server.graphic.SPageNode;
import org.openlowcode.server.graphic.widget.SActionButton;
import org.openlowcode.server.graphic.widget.SComponentBand;
import org.openlowcode.server.graphic.widget.SIntegerField;
import org.openlowcode.server.graphic.widget.SPageText;

/**
 * Page to perform session cleaning
 *
 * @author Open Lowcode
 *         SAS
 */
public class SessioncleaningPage extends AbsSessioncleaningPage {

    /**
     * create the page
     *
     * @param numberofitems
     * @param oldestlog
     */
    public SessioncleaningPage(Integer numberofitems, Integer oldestlog) {
        super(numberofitems, oldestlog);
    }

    @Override
    public String generateTitle(Integer numberofitems, Integer oldestlog) {
        return "Clean Sessions";
    }

    @Override
    protected SPageNode getContent() {
        SComponentBand mainband = new SComponentBand(SComponentBand.DIRECTION_DOWN, this);
        mainband.addElement(new SPageText("Session Log cleaning", SPageText.TYPE_TITLE, this));
        SIntegerField numberofrecords = new SIntegerField("Number of records", "RECORDS", "", this.getNumberofitems(), false, this, true, false, false, null);
        mainband.addElement(numberofrecords);
        SIntegerField oldestlog = new SIntegerField("Oldest log (days)", "OLDESTLOGS", "", this.getOldestlog(), false, this, true, false, false, null);
        mainband.addElement(oldestlog);
        SessioncleaningAction.ActionRef sessi

oncleaningaction = SessioncleaningAction.get().getActionRef();
        SIntegerField keepdays = new SIntegerField("Keep days of history", "KEEPDAYS", "", new Integer(31), false, this, false, false, false, sessioncleaningaction);
        mainband.addElement(keepdays);
        sessioncleaningaction.setCleansessionsolderthandays(keepdays.getIntegerInput());
        SActionButton clean = new SActionButton("Clean older logs", sessioncleaningaction, this);
        SComponentBand buttonband = new SComponentBand(SComponentBand.DIRECTION_RIGHT, this);
        buttonband.addElement(clean);
        AtgLaunchsearchusersessionAction.ActionRef searchsessionlogs = AtgLaunchsearchusersessionAction.get().getActionRef();
        buttonband.addElement(new SActionButton("Search Session Logs", searchsessionlogs, this));
        mainband.addElement(buttonband);
        return mainband;
    }
}


package org.switchyard.validate.internal;

import org.switchyard.SwitchYardException;

/**
 * A DuplicateValidatorException is thrown by SwitchYard when a duplicate validator
 * is trying to be registered for a 'name' type for which there already exists
 * a validator in the validator registry.
 *
 * @author Tomohisa Igarashi
 */
public class DuplicateValidatorException extends SwitchYardException {

    /**
     * Serial version unique id.
     */
    private static final long serialVersionUID = -8937972965502786027L;

    /**
     * Public constructor.
     * @param message Exception message.
     */
    public DuplicateValidatorException(final String message) {
        super(message);
    }

    /**
     * Public constructor.
     * @param message Exception message.
     * @param cause Throwable cause.
     */
    public Dupl

icateValidatorException(final String message, final Throwable cause) {
        super(message, cause);
    }
}


public static int dp2pxConvertInt(Context context, float dpValue)

package com.wpy.danmudemo.utils;

import android.content.Context;
import android.util.TypedValue;

/**
 * 像素转换
 * Created by feiyang on 16/3/2.
 */
public class DpOrSp2PxUtil {

{
        return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dpValue, context.getResources().getDisplayMetrics());
    }

    public static int sp2pxConvertInt(Context context, float spValue) {
        return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, spValue, context.getResources().getDisplayMetrics());
    }

    public static float dp2px(Context context, float dpValue) {
        return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dpValue, context.getResources().getDisplayMetrics());
    }

    public static float sp2px(Context context, float spValue) {
        return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, spValue, context.getResources().getDisplayMetrics());
    }
}


{
        return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dpValue, context.getResources().getDisplayMetrics());
    }

package com.wpy.danmudemo.utils;

import android.content.Context;
import android.util.TypedValue;

/**
 * 像素转换
 * Created by feiyang on 16/3/2.
 */
public class DpOrSp2PxUtil {

    public static int dp2pxConvertInt(Context context, float dpValue)

    public static int sp2pxConvertInt(Context context, float spValue) {
        return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, spValue, context.getResources().getDisplayMetrics());
    }

    public static float dp2px(Context context, float dpValue) {
        return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dpValue, context.getResources().getDisplayMetrics());
    }

    public static float sp2px(Context context, float spValue) {
        return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, spValue, context.getResources().getDisplayMetrics());
    }
}


package com.wpy.danmudemo.utils;

import android.content.Context;
import android.util.TypedValue;

/**
 * 像素转换
 * Created by feiyang on 16/3/2.
 */
public class DpOrSp2PxUtil {

    public static int dp2pxConvertInt(Context context, float dpValue) {
        return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dpValue, context.getResources().getDispla

    }

    public static int sp2pxConvertInt(Context context, float spValue) {
        return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, spValue, context.getResources().getDisplayMetrics());
    }

    public static float dp2px(Context context, float dpValue) {
        return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dpValue, context.getResources().getDisplayMetrics());
    }

    public static float sp2px(Context context, float spValue) {
        return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, spValue, context.getResources().getDisplayMetrics());
    }
}


package com.wpy.danmudemo.utils;

import android.content.Context;
import android.util.TypedValue;

/**
 * 像素转换
 * Created by feiyang on 16/3/2.
 */
public class DpOrSp2PxUtil {

    public static int dp2pxConvertInt(Context context, float dpValue) {
        return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dpValue, context.getResources().getDisplayMetrics());
    }

    public static int sp2pxConvertInt(Context context, float spValue) {
        return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, spValue, context.getResources().getDisplayMetrics());
    }

    public static float dp2px(Context context, float dpValue) {
        return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dpValue, context.getResources().getDisplayMetrics());
    }

    public sta

tic float sp2px(Context context, float spValue) {
        return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, spValue, context.getResources().getDisplayMetrics());
    }
}


package com.flowci.core.secret.domain;

import com.flowci.domain.SecretField;
import lombok.Getter;
import l

ombok.Setter;
import org.springframework.data.mongodb.core.mapping.Document;

@Getter
@Setter
@Document(collection = "secret")
public class KubeConfigSecret extends Secret {

    private SecretField content;

    public KubeConfigSecret() {
        setCategory(Category.KUBE_CONFIG);
    }
}


@Override
    public int getARGB(int x, int y)

package drawingbot.image;

/**
 * an implementation of {@link drawingbot.api.IPixelData} optimised for quick access to perceived luminance values and the cached average
 */
// TODO ISSUE WITH LUMINANCE VALUES?
public class PixelDataLuminance extends PixelDataAbstract {

    public RawData luminance;

    private final float[] hsbCache = new float[3];

    private final int[] argbCache = new int[4];

    public PixelDataLuminance(int width, int height) {
        super(width, height);
        this.luminance = new RawData(width, height);
    }

{
        int g = luminance.getData(x, y);
        return ImageTools.getARGB(255, g, g, g);
    }

    @Override
    public void setARGB(int x, int y, int argb) {
        ImageTools.getColourIntsFromARGB(argb, argbCache);
        luminance.setData(x, y, ImageTools.getPerceivedLuminanceFromRGB(argbCache[1], argbCache[2], argbCache[3]));
    }

    @Override
    public void setARGB(int x, int y, int a, int r, int g, int b) {
        luminance.setData(x, y, ImageTools.getPerceivedLuminanceFromRGB(r, g, b));
    }

    @Override
    public int getChannel(int channel, int x, int y) {
        return luminance.getData(x, y);
    }

    @Override
    public void setChannel(int channel, int x, int y, int value) {
        luminance.setData(x, y, value);
    }

    @Override
    public void adjustChannel(int channel, int x, int y, int value) {
        luminance.adjustData(x, y, value);
    }

    @Override
    public double getAverageChannel(int channel) {
        return luminance.getAverage();
    }

    @Override
    public int getHSB(int type, int x, int y) {
        return 0;
    }

    @Override
    public void setHSB(int type, int x, int y, int value) {
    }

    @Override
    public void adjustHSB(int type, int x, int y, int value) {
    }

    @Override
    public double getAverageHSB(int type) {
        return 0;
    }

    @Override
    public int getLuminance(int x, int y) {
        return luminance.getData(x, y);
    }

    @Override
    public void setLuminance(int x, int y, int lum) {
        luminance.setData(x, y, lum);
    }

    @Override
    public void adjustLuminance(int x, int y, int lum) {
        luminance.adjustData(x, y, lum);
    }

    @Override
    public double getAverageLuminance() {
        return luminance.getAverage();
    }
}


{
        int g = luminance.getData(x, y);
        return ImageTools.getARGB(255, g, g, g);
    }

package drawingbot.image;

/**
 * an implementation of {@link drawingbot.api.IPixelData} optimised for quick access to perceived luminance values and the cached average
 */
// TODO ISSUE WITH LUMINANCE VALUES?
public class PixelDataLuminance extends PixelDataAbstract {

    public RawData luminance;

    private final float[] hsbCache = new float[3];

    private final int[] argbCache = new int[4];

    public PixelDataLuminance(int width, int height) {
        super(width, height);
        this.luminance = new RawData(width, height);
    }

    @Override
    public int getARGB(int x, int y)

    @Override
    public void setARGB(int x, int y, int argb) {
        ImageTools.getColourIntsFromARGB(argb, argbCache);
        luminance.setData(x, y, ImageTools.getPerceivedLuminanceFromRGB(argbCache[1], argbCache[2], argbCache[3]));
    }

    @Override
    public void setARGB(int x, int y, int a, int r, int g, int b) {
        luminance.setData(x, y, ImageTools.getPerceivedLuminanceFromRGB(r, g, b));
    }

    @Override
    public int getChannel(int channel, int x, int y) {
        return luminance.getData(x, y);
    }

    @Override
    public void setChannel(int channel, int x, int y, int value) {
        luminance.setData(x, y, value);
    }

    @Override
    public void adjustChannel(int channel, int x, int y, int value) {
        luminance.adjustData(x, y, value);
    }

    @Override
    public double getAverageChannel(int channel) {
        return luminance.getAverage();
    }

    @Override
    public int getHSB(int type, int x, int y) {
        return 0;
    }

    @Override
    public void setHSB(int type, int x, int y, int value) {
    }

    @Override
    public void adjustHSB(int type, int x, int y, int value) {
    }

    @Override
    public double getAverageHSB(int type) {
        return 0;
    }

    @Override
    public int getLuminance(int x, int y) {
        return luminance.getData(x, y);
    }

    @Override
    public void setLuminance(int x, int y, int lum) {
        luminance.setData(x, y, lum);
    }

    @Override
    public void adjustLuminance(int x, int y, int lum) {
        luminance.adjustData(x, y, lum);
    }

    @Override
    public double getAverageLuminance() {
        return luminance.getAverage();
    }
}


package drawingbot.image;

/**
 * an implementation of {@link drawingbot.api.IPixelData} optimised for quick access to perceived luminance values and the cached average
 */
// TODO ISSUE WITH LUMINANCE VALUES?
public class PixelDataLuminance extends PixelDataAbstract {

    public RawData luminance;

    private final float[] hsbCache = new float[3];

    private final int[] argbCache = new int[4];

    public PixelDataLuminance(int width, int height) {
        super(width, height);
        this.luminance = new RawData(width, height);
    }

    @Override
    public int getARGB(int x, int y) {
        int g = luminance.getData(x, y);
        return ImageTools.getARGB(255, g, g, g);
    }

    @Override
    public void setARGB(int x, int y, int argb) {
        ImageTools.getColourIntsFromARGB(argb, argbCache);
        luminance.setData(x, y, ImageTools.getPerceivedLuminanceFromRGB(argbCache[1], argbCache[2], argbCache[3]));
    }

    @Override
    public void setARGB(int x, int y, int a, int r, int g, int b) {
        luminance.setData(x, y, ImageTools.getPerceivedLuminanceFromRGB(r, g, b));
    }

    @Override
    public int getChannel(int channel, int x, int y) {
        return luminance.getData(x, y);
    }

    @Override
    public void setChannel(int channel, int x, int y, int value) {
        luminance.setData(x, y, value);
    }

    @Override
    public void adjustChannel(int channel, int x, int y, int value) {
        luminance.adjustData(x, y, value);
    }

    @Override
    public double getAverageChannel(int channel) {
        return luminance.getAverage();
    }

    @Override
    public int getHSB(int type, int x, int y) {
        r

    }

    @Override
    public void setHSB(int type, int x, int y, int value) {
    }

    @Override
    public void adjustHSB(int type, int x, int y, int value) {
    }

    @Override
    public double getAverageHSB(int type) {
        return 0;
    }

    @Override
    public int getLuminance(int x, int y) {
        return luminance.getData(x, y);
    }

    @Override
    public void setLuminance(int x, int y, int lum) {
        luminance.setData(x, y, lum);
    }

    @Override
    public void adjustLuminance(int x, int y, int lum) {
        luminance.adjustData(x, y, lum);
    }

    @Override
    public double getAverageLuminance() {
        return luminance.getAverage();
    }
}


package drawingbot.image;

/**
 * an implementation of {@link drawingbot.api.IPixelData} optimised for quick access to perceived luminance values and the cached average
 */
// TODO ISSUE WITH LUMINANCE VALUES?
public class PixelDataLuminance extends PixelDataAbstract {

    public RawData luminance;

    private final floa

t[] hsbCache = new float[3];

    private final int[] argbCache = new int[4];

    public PixelDataLuminance(int width, int height) {
        super(width, height);
        this.luminance = new RawData(width, height);
    }

    @Override
    public int getARGB(int x, int y) {
        int g = luminance.getData(x, y);
        return ImageTools.getARGB(255, g, g, g);
    }

    @Override
    public void setARGB(int x, int y, int argb) {
        ImageTools.getColourIntsFromARGB(argb, argbCache);
        luminance.setData(x, y, ImageTools.getPerceivedLuminanceFromRGB(argbCache[1], argbCache[2], argbCache[3]));
    }

    @Override
    public void setARGB(int x, int y, int a, int r, int g, int b) {
        luminance.setData(x, y, ImageTools.getPerceivedLuminanceFromRGB(r, g, b));
    }

    @Override
    public int getChannel(int channel, int x, int y) {
        return luminance.getData(x, y);
    }

    @Override
    public void setChannel(int channel, int x, int y, int value) {
        luminance.setData(x, y, value);
    }

    @Override
    public void adjustChannel(int channel, int x, int y, int value) {
        luminance.adjustData(x, y, value);
    }

    @Override
    public double getAverageChannel(int channel) {
        return luminance.getAverage();
    }

    @Override
    public int getHSB(int type, int x, int y) {
        return 0;
    }

    @Override
    public void setHSB(int type, int x, int y, int value) {
    }

    @Override
    public void adjustHSB(int type, int x, int y, int value) {
    }

    @Override
    public double getAverageHSB(int type) {
        return 0;
    }

    @Override
    public int getLuminance(int x, int y) {
        return luminance.getData(x, y);
    }

    @Override
    public void setLuminance(int x, int y, int lum) {
        luminance.setData(x, y, lum);
    }

    @Override
    public void adjustLuminance(int x, int y, int lum) {
        luminance.adjustData(x, y, lum);
    }

    @Override
    public double getAverageLuminance() {
        return luminance.getAverage();
    }
}


package com.huaweicloud.sdk.as.v1.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.huaweicloud.sdk.core.SdkResponse;
import java.util.Objects;
import java.util.function.Consumer;

/**
 * Response Object
 */
public class ShowApiVersionResponse extends SdkResponse {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "version")
    private VersionInfo version;

    public ShowApiVersionResponse withVersion(VersionInfo version) {
        this.version = version;
        return this;
    }

    public ShowApiVersionResponse withVersion(Consumer<VersionInfo> versionSetter) {
        if (this.version == null) {
            this.version = new VersionInfo();
            versionSetter.accept(this.version);
        }
        return this;
    }

    /**
     * Get version
     *
     * @return version
     */
    public VersionInfo getVersion() {
        return version;
    }

    public void setVersion(VersionInfo version) {
        this.version = version;
    }

    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ShowApiVersionResponse showApiVersionResponse = (ShowApiVersionResponse) o;
        return Objects.equals(this.version, showApiVersionResponse.version);
    }

{
        return Objects.hash(version);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class ShowApiVersionResponse {\n");
        sb.append("    version: ").append(toIndentedString(version)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }
}


{
        return Objects.hash(version);
    }

package com.huaweicloud.sdk.as.v1.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.huaweicloud.sdk.core.SdkResponse;
import java.util.Objects;
import java.util.function.Consumer;

/**
 * Response Object
 */
public class ShowApiVersionResponse extends SdkResponse {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "version")
    private VersionInfo version;

    public ShowApiVersionResponse withVersion(VersionInfo version) {
        this.version = version;
        return this;
    }

    public ShowApiVersionResponse withVersion(Consumer<VersionInfo> versionSetter) {
        if (this.version == null) {
            this.version = new VersionInfo();
            versionSetter.accept(this.version);
        }
        return this;
    }

    /**
     * Get version
     *
     * @return version
     */
    public VersionInfo getVersion() {
        return version;
    }

    public void setVersion(VersionInfo version) {
        this.version = version;
    }

    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ShowApiVersionResponse showApiVersionResponse = (ShowApiVersionResponse) o;
        return Objects.equals(this.version, showApiVersionResponse.version);
    }

    @Override
    public int hashCode()

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class ShowApiVersionResponse {\n");
        sb.append("    version: ").append(toIndentedString(version)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }
}


        StringBuilder sb = new StringBuilder();
        sb.append("class ShowApiVersionResponse {\n");

package com.huaweicloud.sdk.as.v1.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.huaweicloud.sdk.core.SdkResponse;
import java.util.Objects;
import java.util.function.Consumer;

/**
 * Response Object
 */
public class ShowApiVersionResponse extends SdkResponse {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "version")
    private VersionInfo version;

    public ShowApiVersionResponse withVersion(VersionInfo version) {
        this.version = version;
        return this;
    }

    public ShowApiVersionResponse withVersion(Consumer<VersionInfo> versionSetter) {
        if (this.version == null) {
            this.version = new VersionInfo();
            versionSetter.accept(this.version);
        }
        return this;
    }

    /**
     * Get version
     *
     * @return version
     */
    public VersionInfo getVersion() {
        return version;
    }

    public void setVersion(VersionInfo version) {
        this.version = version;
    }

    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ShowApiVersionResponse showApiVersionResponse = (ShowApiVersionResponse) o;
        return Objects.equals(this.version, showApiVersionResponse.version);
    }

    @Override
    public int hashCode() {
        return Objects.hash(version);
    }

    @Override
    public String toString() {

        sb.append("    version: ").append(toIndentedString(version)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }
}


sb.append("    version: ").append(toIndentedString(version)).append("\n");
        sb.append("}");

package com.huaweicloud.sdk.as.v1.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.huaweicloud.sdk.core.SdkResponse;
import java.util.Objects;
import java.util.function.Consumer;

/**
 * Response Object
 */
public class ShowApiVersionResponse extends SdkResponse {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "version")
    private VersionInfo version;

    public ShowApiVersionResponse withVersion(VersionInfo version) {
        this.version = version;
        return this;
    }

    public ShowApiVersionResponse withVersion(Consumer<VersionInfo> versionSetter) {
        if (this.version == null) {
            this.version = new VersionInfo();
            versionSetter.accept(this.version);
        }
        return this;
    }

    /**
     * Get version
     *
     * @return version
     */
    public VersionInfo getVersion() {
        return version;
    }

    public void setVersion(VersionInfo version) {
        this.version = version;
    }

    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ShowApiVersionResponse showApiVersionResponse = (ShowApiVersionResponse) o;
        return Objects.equals(this.version, showApiVersionResponse.version);
    }

    @Override
    public int hashCode() {
        return Objects.hash(version);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class ShowApiVersionResponse {\n");

        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }
}


package com.huaweicloud.sdk.as.v1.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.huaweicloud.sdk.core.SdkResponse;
import java.util.Objects;
import java.util.function.Consumer;

/**
 * Response Object
 */
public class ShowApiVersionResponse extends SdkResponse {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "version")
    private VersionInfo version;

    public ShowApiVersionResponse withVersion(VersionInfo version) {
        this.version = version;
        return this;
    }

    public ShowApiVersionResponse withVersion(Consumer<VersionInfo> versionSetter) {
        if (this.version == null) {
            this.version = new VersionInfo();
            versionSetter.accept(this.version);
        }
        return this;
    }

    /**
     * Get version
     *
     * @return version
     */
    public VersionInfo getVersion() {
        return version;
    }

    public void setVersion(VersionInfo version) {
        this.version = version;
    }

    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ShowApiVersionResponse showApiVersionResponse = (ShowApiVersionResponse) o;
        return Objects.equals(this.version, showApiVersionResponse.version);
    }

    @Override
    public int hashCode() {
        return Objects.hash(version);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class ShowApiVersionResponse {\n");
        sb.append("    version: ").append(toIndentedString(version)).append("\n");
        sb.append("}");

    /**
     * Convert the given object to string with each line indented by 4 spaces (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }
}


sionResponse = (ShowApiVersionResponse) o;

package com.huaweicloud.sdk.as.v1.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.huaweicloud.sdk.core.SdkResponse;
import java.util.Objects;
import java.util.function.Consumer;

/**
 * Response Object
 */
public class ShowApiVersionResponse extends SdkResponse {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "version")
    private VersionInfo version;

    public ShowApiVersionResponse withVersion(VersionInfo version) {
        this.version = version;
        return this;
    }

    public ShowApiVersionResponse withVersion(Consumer<VersionInfo> versionSetter) {
        if (this.version == null) {
            this.version = new VersionInfo();
            versionSetter.accept(this.version);
        }
        return this;
    }

    /**
     * Get version
     *
     * @return version
     */
    public VersionInfo getVersion() {
        return version;
    }

    public void setVersion(VersionInfo version) {
        this.version = version;
    }

    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ShowApiVersionResponse showApiVer

        return Objects.equals(this.version, showApiVersionResponse.version);
    }

    @Override
    public int hashCode() {
        return Objects.hash(version);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class ShowApiVersionResponse {\n");
        sb.append("    version: ").append(toIndentedString(version)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }
}


public VersionInfo getVersion() {
        return version;
    }

package com.huaweicloud.sdk.as.v1.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.huaweicloud.sdk.core.SdkResponse;
import java.util.Objects;
import java.util.function.Consumer;

/**
 * Response Object
 */
public class ShowApiVersionResponse extends SdkResponse {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "version")
    private VersionInfo version;

    public ShowApiVersionResponse withVersion(VersionInfo version) {
        this.version = version;
        return this;
    }

    public ShowApiVersionResponse withVersion(Consumer<VersionInfo> versionSetter) {
        if (this.version == null) {
            this.version = new VersionInfo();
            versionSetter.accept(this.version);
        }
        return this;
    }

    /**
     * Get version
     *
     * @return version
     */

    public void setVersion(VersionInfo version) {
        this.version = version;
    }

    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ShowApiVersionResponse showApiVersionResponse = (ShowApiVersionResponse) o;
        return Objects.equals(this.version, showApiVersionResponse.version);
    }

    @Override
    public int hashCode() {
        return Objects.hash(version);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class ShowApiVersionResponse {\n");
        sb.append("    version: ").append(toIndentedString(version)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }
}


if (this == o) {
            return true;
        }

package com.huaweicloud.sdk.as.v1.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.huaweicloud.sdk.core.SdkResponse;
import java.util.Objects;
import java.util.function.Consumer;

/**
 * Response Object
 */
public class ShowApiVersionResponse extends SdkResponse {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "version")
    private VersionInfo version;

    public ShowApiVersionResponse withVersion(VersionInfo version) {
        this.version = version;
        return this;
    }

    public ShowApiVersionResponse withVersion(Consumer<VersionInfo> versionSetter) {
        if (this.version == null) {
            this.version = new VersionInfo();
            versionSetter.accept(this.version);
        }
        return this;
    }

    /**
     * Get version
     *
     * @return version
     */
    public VersionInfo getVersion() {
        return version;
    }

    public void setVersion(VersionInfo version) {
        this.version = version;
    }

    @Override
    public boolean equals(java.lang.Object o) {

        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ShowApiVersionResponse showApiVersionResponse = (ShowApiVersionResponse) o;
        return Objects.equals(this.version, showApiVersionResponse.version);
    }

    @Override
    public int hashCode() {
        return Objects.hash(version);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class ShowApiVersionResponse {\n");
        sb.append("    version: ").append(toIndentedString(version)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }
}


package com.huaweicloud.sdk.as.v1.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.huaweicloud.sdk.core.SdkResponse;
import java.util.Objects;
import java.util.function.Consumer;

/**
 * Response Object
 */
publi

c class ShowApiVersionResponse extends SdkResponse {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "version")
    private VersionInfo version;

    public ShowApiVersionResponse withVersion(VersionInfo version) {
        this.version = version;
        return this;
    }

    public ShowApiVersionResponse withVersion(Consumer<VersionInfo> versionSetter) {
        if (this.version == null) {
            this.version = new VersionInfo();
            versionSetter.accept(this.version);
        }
        return this;
    }

    /**
     * Get version
     *
     * @return version
     */
    public VersionInfo getVersion() {
        return version;
    }

    public void setVersion(VersionInfo version) {
        this.version = version;
    }

    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ShowApiVersionResponse showApiVersionResponse = (ShowApiVersionResponse) o;
        return Objects.equals(this.version, showApiVersionResponse.version);
    }

    @Override
    public int hashCode() {
        return Objects.hash(version);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class ShowApiVersionResponse {\n");
        sb.append("    version: ").append(toIndentedString(version)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }
}


@com.oracle.bmc.InternalSdk
        public Builder body$(com.oracle.bmc.dns.model.CreateTsigKeyDetails body)

package com.oracle.bmc.dns.requests;

import com.oracle.bmc.dns.model.*;

/**
 * Example: Click here to see how to use CreateTsigKeyRequest.
 */
@javax.annotation.Generated(value = "OracleSDKGenerator", comments = "API Version: 20180115")
@lombok.Builder(builderClassName = "Builder", buildMethodName = "buildWithoutInvocationCallback", toBuilder = true)
@lombok.ToString(callSuper = true)
@lombok.EqualsAndHashCode(callSuper = true)
@lombok.Getter
public class CreateTsigKeyRequest extends com.oracle.bmc.requests.BmcRequest<com.oracle.bmc.dns.model.CreateTsigKeyDetails> {

    /**
     * Details for creating a new TSIG key.
     */
    private com.oracle.bmc.dns.model.CreateTsigKeyDetails createTsigKeyDetails;

    /**
     * Unique Oracle-assigned identifier for the request. If you need
     * to contact Oracle about a particular request, please provide
     * the request ID.
     */
    private String opcRequestId;

    /**
     * Specifies to operate only on resources that have a matching DNS scope.
     */
    private com.oracle.bmc.dns.model.Scope scope;

    /**
     * Alternative accessor for the body parameter.
     * @return body parameter
     */
    @Override
    @com.oracle.bmc.InternalSdk
    public com.oracle.bmc.dns.model.CreateTsigKeyDetails getBody$() {
        return createTsigKeyDetails;
    }

    public static class Builder implements com.oracle.bmc.requests.BmcRequest.Builder<CreateTsigKeyRequest, com.oracle.bmc.dns.model.CreateTsigKeyDetails> {

        private com.oracle.bmc.util.internal.Consumer<javax.ws.rs.client.Invocation.Builder> invocationCallback = null;

        private com.oracle.bmc.retrier.RetryConfiguration retryConfiguration = null;

        /**
         * Set the invocation callback for the request to be built.
         * @param invocationCallback the invocation callback to be set for the request
         * @return this builder instance
         */
        public Builder invocationCallback(com.oracle.bmc.util.internal.Consumer<javax.ws.rs.client.Invocation.Builder> invocationCallback) {
            this.invocationCallback = invocationCallback;
            return this;
        }

        /**
         * Set the retry configuration for the request to be built.
         * @param retryConfiguration the retry configuration to be used for the request
         * @return this builder instance
         */
        public Builder retryConfiguration(com.oracle.bmc.retrier.RetryConfiguration retryConfiguration) {
            this.retryConfiguration = retryConfiguration;
            return this;
        }

        /**
         * Copy method to populate the builder with values from the given instance.
         * @return this builder instance
         */
        public Builder copy(CreateTsigKeyRequest o) {
            createTsigKeyDetails(o.getCreateTsigKeyDetails());
            opcRequestId(o.getOpcRequestId());
            scope(o.getScope());
            invocationCallback(o.getInvocationCallback());
            retryConfiguration(o.getRetryConfiguration());
            return this;
        }

        /**
         * Build the instance of CreateTsigKeyRequest as configured by this builder
         *
         * Note that this method takes calls to {@link Builder#invocationCallback(com.oracle.bmc.util.internal.Consumer)} into account,
         * while the method {@link Builder#buildWithoutInvocationCallback} does not.
         *
         * This is the preferred method to build an instance.
         *
         * @return instance of CreateTsigKeyRequest
         */
        public CreateTsigKeyRequest build() {
            CreateTsigKeyRequest request = buildWithoutInvocationCallback();
            request.setInvocationCallback(invocationCallback);
            request.setRetryConfiguration(retryConfiguration);
            return request;
        }

        /**
         * Alternative setter for the body parameter.
         * @param body the body parameter
         * @return this builder instance
         */

{
            createTsigKeyDetails(body);
            return this;
        }
    }
}