Search in sources :

Example 1 with V3GlusterHook

use of org.ovirt.engine.api.v3.types.V3GlusterHook in project ovirt-engine by oVirt.

the class V3GlusterHookInAdapter method adapt.

@Override
public GlusterHook adapt(V3GlusterHook from) {
    GlusterHook to = new GlusterHook();
    if (from.isSetLinks()) {
        to.getLinks().addAll(adaptIn(from.getLinks()));
    }
    if (from.isSetActions()) {
        to.setActions(adaptIn(from.getActions()));
    }
    if (from.isSetChecksum()) {
        to.setChecksum(from.getChecksum());
    }
    if (from.isSetCluster()) {
        to.setCluster(adaptIn(from.getCluster()));
    }
    if (from.isSetComment()) {
        to.setComment(from.getComment());
    }
    if (from.isSetConflictStatus()) {
        to.setConflictStatus(from.getConflictStatus());
    }
    if (from.isSetConflicts()) {
        to.setConflicts(from.getConflicts());
    }
    if (from.isSetContent()) {
        to.setContent(from.getContent());
    }
    if (from.isSetContentType()) {
        to.setContentType(HookContentType.fromValue(from.getContentType()));
    }
    if (from.isSetDescription()) {
        to.setDescription(from.getDescription());
    }
    if (from.isSetGlusterCommand()) {
        to.setGlusterCommand(from.getGlusterCommand());
    }
    if (from.isSetId()) {
        to.setId(from.getId());
    }
    if (from.isSetHref()) {
        to.setHref(from.getHref());
    }
    if (from.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetServerHooks()) {
        to.setServerHooks(new GlusterServerHooks());
        to.getServerHooks().getGlusterServerHooks().addAll(adaptIn(from.getServerHooks().getGlusterServerHooks()));
    }
    if (from.isSetStage()) {
        to.setStage(HookStage.fromValue(from.getStage()));
    }
    if (from.isSetStatus() && from.getStatus().isSetState()) {
        to.setStatus(GlusterHookStatus.fromValue(from.getStatus().getState()));
    }
    return to;
}
Also used : GlusterServerHooks(org.ovirt.engine.api.model.GlusterServerHooks) V3GlusterHook(org.ovirt.engine.api.v3.types.V3GlusterHook) GlusterHook(org.ovirt.engine.api.model.GlusterHook)

Example 2 with V3GlusterHook

use of org.ovirt.engine.api.v3.types.V3GlusterHook in project ovirt-engine by oVirt.

the class V3GlusterHookOutAdapter method adapt.

@Override
public V3GlusterHook adapt(GlusterHook from) {
    V3GlusterHook to = new V3GlusterHook();
    if (from.isSetLinks()) {
        to.getLinks().addAll(adaptOut(from.getLinks()));
    }
    if (from.isSetActions()) {
        to.setActions(adaptOut(from.getActions()));
    }
    if (from.isSetChecksum()) {
        to.setChecksum(from.getChecksum());
    }
    if (from.isSetCluster()) {
        to.setCluster(adaptOut(from.getCluster()));
    }
    if (from.isSetComment()) {
        to.setComment(from.getComment());
    }
    if (from.isSetConflictStatus()) {
        to.setConflictStatus(from.getConflictStatus());
    }
    if (from.isSetConflicts()) {
        to.setConflicts(from.getConflicts());
    }
    if (from.isSetContent()) {
        to.setContent(from.getContent());
    }
    if (from.isSetContentType()) {
        to.setContentType(from.getContentType().value());
    }
    if (from.isSetDescription()) {
        to.setDescription(from.getDescription());
    }
    if (from.isSetGlusterCommand()) {
        to.setGlusterCommand(from.getGlusterCommand());
    }
    if (from.isSetId()) {
        to.setId(from.getId());
    }
    if (from.isSetHref()) {
        to.setHref(from.getHref());
    }
    if (from.isSetName()) {
        to.setName(from.getName());
    }
    if (from.isSetServerHooks()) {
        to.setServerHooks(new V3GlusterServerHooks());
        to.getServerHooks().getGlusterServerHooks().addAll(adaptOut(from.getServerHooks().getGlusterServerHooks()));
    }
    if (from.isSetStage()) {
        to.setStage(from.getStage().value());
    }
    if (from.isSetStatus()) {
        V3Status status = new V3Status();
        status.setState(from.getStatus().value());
        to.setStatus(status);
    }
    return to;
}
Also used : V3GlusterHook(org.ovirt.engine.api.v3.types.V3GlusterHook) V3Status(org.ovirt.engine.api.v3.types.V3Status) V3GlusterServerHooks(org.ovirt.engine.api.v3.types.V3GlusterServerHooks)

Aggregations

V3GlusterHook (org.ovirt.engine.api.v3.types.V3GlusterHook)2 GlusterHook (org.ovirt.engine.api.model.GlusterHook)1 GlusterServerHooks (org.ovirt.engine.api.model.GlusterServerHooks)1 V3GlusterServerHooks (org.ovirt.engine.api.v3.types.V3GlusterServerHooks)1 V3Status (org.ovirt.engine.api.v3.types.V3Status)1