core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SDKManagerCacheEntry.java
branchC3_BUILDER_WORK
changeset 1715 ff0db4bbc189
equal deleted inserted replaced
1710:94cdcd7c5550 1715:ff0db4bbc189
       
     1 package com.nokia.carbide.cpp.internal.sdk.core.model;
       
     2 
       
     3 import java.io.Serializable;
       
     4 
       
     5 public class SDKManagerCacheEntry implements Serializable {
       
     6 
       
     7 	private static final long serialVersionUID = 3694246766733614433L;
       
     8 
       
     9 	private String id;
       
    10 	private String epocRoot;
       
    11 	private String osVersion;
       
    12 	private boolean isEnabled;
       
    13 
       
    14 	public SDKManagerCacheEntry() {
       
    15 		this.id = "";
       
    16 		this.epocRoot = "";
       
    17 		this.osVersion = "";
       
    18 		this.isEnabled = false;
       
    19 	}
       
    20 
       
    21 	public SDKManagerCacheEntry(String id, String epocRoot, String osVersion, boolean isEnabled) {
       
    22 		this.id = id;
       
    23 		this.epocRoot = epocRoot;
       
    24 		this.osVersion = osVersion;
       
    25 		this.isEnabled = isEnabled;
       
    26 	}
       
    27 
       
    28 	public String getEpocRoot() {
       
    29 		return epocRoot;
       
    30 	}
       
    31 
       
    32 	public String getId() {
       
    33 		return this.id;
       
    34 	}
       
    35 
       
    36 	public String getOsVersion() {
       
    37 		return this.osVersion;
       
    38 	}
       
    39 
       
    40 	public boolean isEnabled() {
       
    41 		return this.isEnabled;
       
    42 	}
       
    43 
       
    44 	public void setEnabled(boolean isEnabled) {
       
    45 		this.isEnabled = isEnabled;
       
    46 	}
       
    47 
       
    48 	public void setEpocRoot(String epocRoot) {
       
    49 		this.epocRoot = epocRoot;
       
    50 	}
       
    51 
       
    52 	public void setId(String id) {
       
    53 		this.id = id;
       
    54 	}
       
    55 
       
    56 	public void setOsVersion(String osVersion) {
       
    57 		this.osVersion = osVersion;
       
    58 	}
       
    59 
       
    60 	@Override
       
    61 	public int hashCode() {
       
    62 		final int prime = 31;
       
    63 		int result = 1;
       
    64 		result = prime * result
       
    65 				+ ((epocRoot == null) ? 0 : epocRoot.hashCode());
       
    66 		result = prime * result + ((id == null) ? 0 : id.hashCode());
       
    67 		result = prime * result + (isEnabled ? 1231 : 1237);
       
    68 		result = prime * result
       
    69 				+ ((osVersion == null) ? 0 : osVersion.hashCode());
       
    70 		return result;
       
    71 	}
       
    72 
       
    73 	@Override
       
    74 	public boolean equals(Object obj) {
       
    75 		if (this == obj)
       
    76 			return true;
       
    77 		if (obj == null)
       
    78 			return false;
       
    79 		if (getClass() != obj.getClass())
       
    80 			return false;
       
    81 		SDKManagerCacheEntry other = (SDKManagerCacheEntry) obj;
       
    82 		if (epocRoot == null) {
       
    83 			if (other.epocRoot != null)
       
    84 				return false;
       
    85 		} else if (!epocRoot.equals(other.epocRoot))
       
    86 			return false;
       
    87 		if (id == null) {
       
    88 			if (other.id != null)
       
    89 				return false;
       
    90 		} else if (!id.equals(other.id))
       
    91 			return false;
       
    92 		if (isEnabled != other.isEnabled)
       
    93 			return false;
       
    94 		if (osVersion == null) {
       
    95 			if (other.osVersion != null)
       
    96 				return false;
       
    97 		} else if (!osVersion.equals(other.osVersion))
       
    98 			return false;
       
    99 		return true;
       
   100 	}
       
   101 
       
   102 }