Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
SIX OVAL - http://code.google.com/p/six-oval/ Copyright (C) 2010 National Institute of Advanced Industrial Science and Technology (AIST) Registration Number: H22PRO-1124 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 package jp.go.aist.six.oval.model.linux;
 
The rpminfo item stores rpm info.

Author(s):
Akihito Nakamura, AIST
Version:
$Id: RpmInfoItem.java 3046 2013-02-21 09:33:57Z nakamura5akihito@gmail.com $
See also:
OVAL Language
 
 public class RpmInfoItem
     extends ItemType
 {
 
     //{0..1}
     private EntityItemStringType        name;
     private EntityItemStringType        arch;
     private EntityItemAnySimpleType     epoch;
     private EntityItemAnySimpleType     release;
     private EntityItemAnySimpleType     version;
     private EntityItemEVRStringType     evr;
     private EntityItemStringType        signature_keyid;
     private EntityItemStringType        extended_name;
     private EntityItemStringType        filepath;



    
Constructor.
 
     public RpmInfoItem()
     {
         this( 0 );
     }
 
 
     public RpmInfoItem(
                     final int id
                     )
     {
         thisid );
     }
 
 
     public RpmInfoItem(
                     final int id,
                     final StatusEnumeration status
                     )
     {
         superidstatus );
 
 //        _oval_platform_type = OvalPlatformType.linux;
 //        _oval_component_type = OvalComponentType.rpminfo;
          = .;
          = .;
     }
 
 //    public RpmInfoItem(
 //                    final int id
 //                    )
 //    {
 //        this( id,
 //                        (String)null,
 //                        (String)null,
 //                        (String)null,
 //                        (String)null,
 //                        (String)null,
 //                        (String)null,
 //                        (String)null
 //                        );
 //    }
//
//
//
//    public RpmInfoItem(
//                    final int id,
//                    final String arch,
//                    final String name,
//                    final String version,
//                    final String release,
//                    final String epoch,
//                    final String evr,
//                    final String sigkeyid
//                    )
//    {
//        super( id, arch, name, version, release, epoch, evr );
//
//        if (sigkeyid != null) {
//            setSignatureKeyId( new EntityItemStringType( sigkeyid ) );
//        }
//
//        _oval_platform_type = OvalPlatformType.linux;
//        _oval_component_type = OvalComponentType.rpminfo;
//    }
//    public RpmInfoItem(
//                    final int id,
//                    final EntityItemStringType arch,
//                    final EntityItemStringType name,
//                    final EntityItemAnySimpleType version,
//                    final EntityItemAnySimpleType release,
//                    final EntityItemAnySimpleType epoch,
//                    final EntityItemEVRStringType evr,
//                    final EntityItemStringType sigkeyid
//                    )
//    {
//        super( id, arch, name, version, release, epoch, evr );
//
//        setSignatureKeyID( sigkeyid );
//    }



    
    public void setName(
                    final EntityItemStringType name
                    )
    {
        this. = name;
    }
    public EntityItemStringType getName()
    {
        return ;
    }
    public RpmInfoItem name(
                    final String name
                    )
    {
        setNamenew EntityItemStringTypename ) );
        return this;
    }
    public RpmInfoItem name(
                    final EntityItemStringType name
                    )
    {
        setNamename );
        return this;
    }




    
    public void setArch(
                    final EntityItemStringType arch
                    )
    {
        this. = arch;
    }
    public EntityItemStringType getArch()
    {
        return ;
    }
    public RpmInfoItem arch(
                    final String arch
                    )
    {
        setArchnew EntityItemStringTypearch ) );
        return this;
    }



    
    public void setEpoch(
                    final EntityItemAnySimpleType epoch
                    )
    {
        if (epoch != null) {
            DatatypeEnumeration  datatype = epoch.getDatatype();
            if (datatype != null) {
                if (datatype == .
                                ||  datatype == .) {
                    //validation: xsd:restriction satisfied.
                } else {
                    throw new IllegalArgumentException(
                                    "invalid epoch: datatype=" + datatype );
                }
            }
        }
        this. = epoch;
    }
    {
        return ;
    }
    public RpmInfoItem epoch(
                    final String epoch
                    )
    {
        setEpochnew EntityItemAnySimpleTypeepoch ) );
        return this;
    }



    
    public void setRelease(
                    final EntityItemAnySimpleType release
                    )
    {
        if (release != null) {
            DatatypeEnumeration  datatype = release.getDatatype();
            if (datatype != null) {
                if (datatype == .
                                ||  datatype == .) {
                    // xsd:restriction satisfied.
                } else {
                    throw new IllegalArgumentException(
                                    "invalid release: datatype=" + datatype );
                }
            }
        }
        this. = release;
    }
    {
        return ;
    }
    public RpmInfoItem release(
                    final String release
                    )
    {
        setReleasenew EntityItemAnySimpleTyperelease ) );
        return this;
    }



    
    public void setVersion(
                    final EntityItemAnySimpleType version
                    )
    {
        if (version != null) {
            DatatypeEnumeration  datatype = version.getDatatype();
            if (datatype != null) {
                if (datatype == .
                                ||  datatype == .) {
                    // xsd:restriction satisfied.
                } else {
                    throw new IllegalArgumentException(
                                    "invalid version: datatype=" + datatype );
                }
            }
        }
        this. = version;
    }
    {
        return ;
    }
    public RpmInfoItem version(
                    final String version
                    )
    {
        setVersionnew EntityItemAnySimpleTypeversion ) );
        return this;
    }



    
    public void setEvr(
                    final EntityItemEVRStringType evr
                    )
    {
        this. = evr;
    }
    {
        return ;
    }
    public RpmInfoItem evr(
                    final String evr
                    )
    {
        setEvrnew EntityItemEVRStringTypeevr ) );
        return this;
    }



    
    public void setSignatureKeyId(
                    final EntityItemStringType signature_keyid
                    )
    {
        this. = signature_keyid;
    }
    {
        return ;
    }
    public RpmInfoItem signatureKeyId(
                    final String signature_keyid
                    )
    {
        setSignatureKeyIdnew EntityItemStringTypesignature_keyid ) );
        return this;
    }



    
    public void setExtendedName(
                    final EntityItemStringType extended_name
                    )
    {
        this. = extended_name;
    }
    {
        return ;
    }



    
    public void setFilepath(
                    final EntityItemStringType filepath
                    )
    {
        this. = filepath;
    }
    {
        return ;
    }
    //**************************************************************
    //  java.lang.Object
    //**************************************************************
    @Override
    public String toString()
    {
        return "rpminfo_item[" + super.toString()
                        + ", name="         + getName()
                        + ", arch="         + getArch()
                        + ", epoch="        + getEpoch()
                        + ", release="      + getRelease()
                        + ", version="      + getVersion()
                        + ", evr="          + getEvr()
                        + ", signature_keyid="  + getSignatureKeyId()
                        + ", extended_name="    + getExtendedName()
                        + ", filepath="     + getFilepath()
             + "]";
    }
//RpmInfoItem
New to GrepCode? Check out our FAQ X