// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.olio.data.object.unit; import android.content.ContentResolver; import android.content.ContentValues; import android.database.Cursor; import android.net.Uri; import com.olio.communication.messages.MessagePayload; import com.olio.olios.model.record.DatabaseRecord; import com.olio.olios.model.record.DatabaseRecordMixins; import com.olio.util.ALog; import java.io.Serializable; import java.util.LinkedList; import java.util.List; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; public class SoftwareProfile extends MessagePayload implements Serializable, DatabaseRecord { public static final String VERSION = "version"; private static String columnProjection[]; private static com.olio.olios.model.record.DatabaseRecord.DatabaseRecordFactory databaseRecordFactory = new com.olio.olios.model.record.DatabaseRecord.DatabaseRecordFactory() { public DatabaseRecord getRecordInstance() { return new SoftwareProfile(); } }; private static final List recordFields; private static final long serialVersionUID = 0x46ab9L; List softwarePackages; List userApplicationList; String version; public SoftwareProfile() { } private static SoftwareProfile firstSoftwareProfileFromCursor(Cursor cursor) { if (cursor != null && cursor.getCount() > 0) { return (SoftwareProfile)DatabaseRecordMixins.recordsFromCursor(cursor, staticFactory()).get(0); } else { return null; } } public static SoftwareProfile softwareProfile(ContentResolver contentresolver) { contentresolver = contentresolver.query(DatabaseRecordMixins.baseUriForTable(staticFactory()), staticColumnProjection(), null, null, null); SoftwareProfile softwareprofile = firstSoftwareProfileFromCursor(contentresolver); if (contentresolver != null) { contentresolver.close(); } contentresolver = softwareprofile; if (softwareprofile == null) { contentresolver = new SoftwareProfile(); } return contentresolver; } public static String[] staticColumnProjection() { return columnProjection; } public static com.olio.olios.model.record.DatabaseRecord.DatabaseRecordFactory staticFactory() { return databaseRecordFactory; } public String[] columnProjection() { return new String[0]; } public String defaultOrderBy() { return null; } public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } else { SoftwareProfile softwareprofile = (SoftwareProfile)obj; return (new EqualsBuilder()).appendSuper(super.equals(obj)).append(softwarePackages, softwareprofile.softwarePackages).append(version, softwareprofile.version).append(userApplicationList, softwareprofile.userApplicationList).isEquals(); } } public com.olio.olios.model.record.DatabaseRecord.DatabaseRecordFactory factory() { return staticFactory(); } public List getSoftwarePackages() { return softwarePackages; } public List getUserApplicationList() { return userApplicationList; } public String getVersion() { return version; } public Cursor handleCustomUriQuery(Uri uri, String as[], String s, String as1[], String s1) { return null; } public int hashCode() { return (new HashCodeBuilder(17, 37)).appendSuper(super.hashCode()).append(softwarePackages).append(version).append(userApplicationList).toHashCode(); } public String indexColumn() { return "_id"; } public List recordFields() { return recordFields; } public void save(ContentResolver contentresolver) { ContentValues contentvalues = DatabaseRecordMixins.valuesForRecord(this); Uri uri = DatabaseRecordMixins.baseUriForTable(factory()); int i = contentresolver.update(DatabaseRecordMixins.baseUriForTable(factory()), contentvalues, null, null); if (i == 0) { contentresolver.insert(uri, contentvalues); } else if (i != 1 && i > 1) { ALog.e("Attempting to save SoftwareProfile and there is more than one row in the table.", new Object[0]); throw new RuntimeException("Attempting to save SoftwareProfile and there is more than one row in the table."); } } public void setSoftwarePackages(List list) { softwarePackages = list; } public void setUserApplicationList(List list) { userApplicationList = list; } public void setVersion(String s) { version = s; } public String tableName() { return "software_profile"; } public Uri tableUri() { return DatabaseRecordMixins.baseUriForTable(factory()); } static { recordFields = new LinkedList(); recordFields.add(new com.olio.olios.model.record.DatabaseRecord.RecordField() { public void assignFromCursor(SoftwareProfile softwareprofile, Cursor cursor) { softwareprofile.setVersion(cursor.getString(0)); } public volatile void assignFromCursor(Object obj, Cursor cursor) { assignFromCursor((SoftwareProfile)obj, cursor); } public String columnName() { return "version"; } public String createType() { return "TEXT"; } public void writeToContentValues(SoftwareProfile softwareprofile, ContentValues contentvalues) { contentvalues.put(columnName(), softwareprofile.getVersion()); } public volatile void writeToContentValues(Object obj, ContentValues contentvalues) { writeToContentValues((SoftwareProfile)obj, contentvalues); } }); columnProjection = DatabaseRecordMixins.columnProjectionFromRecordFields(recordFields); } }