1123 1124 /** 1125 * Returns the value of the <a href="#PATCH">patch</a> element of the 1126 * version number, or zero if it is absent. 1127 * 1128 * @return The value of the patch element, or zero 1129 * 1130 * @since 10 1131 */ 1132 public int patch() { 1133 return (version.size() > 3 ? version.get(3) : 0); 1134 } 1135 1136 /** 1137 * Returns the value of the major element of the version number. 1138 * 1139 * @deprecated As of Java SE 10, the first element of a version 1140 * number is not the major-release number but the feature-release 1141 * counter, incremented for every time-based release. Use the {@link 1142 * #feature()} method in preference to this method. For compatibility, 1143 * this method returns the value of the <a href="FEATURE">feature</a> 1144 * element. 1145 * 1146 * @return The value of the feature element 1147 */ 1148 @Deprecated(since = "10") 1149 public int major() { 1150 return feature(); 1151 } 1152 1153 /** 1154 * Returns the value of the minor element of the version number, or 1155 * zero if it is absent. 1156 * 1157 * @deprecated As of Java SE 10, the second element of a version 1158 * number is not the minor-release number but the interim-release 1159 * counter, incremented for every interim release. Use the {@link 1160 * #interim()} method in preference to this method. For compatibility, 1161 * this method returns the value of the <a href="INTERIM">interim</a> 1162 * element, or zero if it is absent. 1163 * 1164 * @return The value of the interim element, or zero 1165 */ 1166 @Deprecated(since = "10") 1167 public int minor() { 1168 return interim(); 1169 } 1170 1171 /** 1172 * Returns the value of the security element of the version number, or 1173 * zero if it is absent. 1174 * 1175 * @deprecated As of Java SE 10, the third element of a version 1176 * number is not the security level but the update-release counter, 1177 * incremented for every update release. Use the {@link #update()} 1178 * method in preference to this method. For compatibility, this method 1179 * returns the value of the <a href="UPDATE">update</a> element, or 1180 * zero if it is absent. 1181 * 1182 * @return The value of the update element, or zero 1183 */ 1184 @Deprecated(since = "10") 1185 public int security() { 1186 return update(); 1187 } 1188 1189 /** 1190 * Returns an unmodifiable {@link java.util.List List} of the integers 1191 * represented in the <a href="#verNum">version number</a>. The {@code 1192 * List} always contains at least one element corresponding to the <a 1193 * href="#feature">feature version number</a>. 1194 * 1195 * @return An unmodifiable list of the integers 1196 * represented in the version number 1197 */ 1198 public List<Integer> version() { 1199 return version; 1200 } 1201 1202 /** 1203 * Returns the optional <a href="#pre">pre-release</a> information. 1204 * 1205 * @return The optional pre-release information as a String 1206 */ 1207 public Optional<String> pre() { 1208 return pre; 1209 } 1210 1211 /** 1212 * Returns the <a href="#build">build number</a>. 1213 * | 1123 1124 /** 1125 * Returns the value of the <a href="#PATCH">patch</a> element of the 1126 * version number, or zero if it is absent. 1127 * 1128 * @return The value of the patch element, or zero 1129 * 1130 * @since 10 1131 */ 1132 public int patch() { 1133 return (version.size() > 3 ? version.get(3) : 0); 1134 } 1135 1136 /** 1137 * Returns the value of the major element of the version number. 1138 * 1139 * @deprecated As of Java SE 10, the first element of a version 1140 * number is not the major-release number but the feature-release 1141 * counter, incremented for every time-based release. Use the {@link 1142 * #feature()} method in preference to this method. For compatibility, 1143 * this method returns the value of the <a href="#FEATURE">feature</a> 1144 * element. 1145 * 1146 * @return The value of the feature element 1147 */ 1148 @Deprecated(since = "10") 1149 public int major() { 1150 return feature(); 1151 } 1152 1153 /** 1154 * Returns the value of the minor element of the version number, or 1155 * zero if it is absent. 1156 * 1157 * @deprecated As of Java SE 10, the second element of a version 1158 * number is not the minor-release number but the interim-release 1159 * counter, incremented for every interim release. Use the {@link 1160 * #interim()} method in preference to this method. For compatibility, 1161 * this method returns the value of the <a href="#INTERIM">interim</a> 1162 * element, or zero if it is absent. 1163 * 1164 * @return The value of the interim element, or zero 1165 */ 1166 @Deprecated(since = "10") 1167 public int minor() { 1168 return interim(); 1169 } 1170 1171 /** 1172 * Returns the value of the security element of the version number, or 1173 * zero if it is absent. 1174 * 1175 * @deprecated As of Java SE 10, the third element of a version 1176 * number is not the security level but the update-release counter, 1177 * incremented for every update release. Use the {@link #update()} 1178 * method in preference to this method. For compatibility, this method 1179 * returns the value of the <a href="#UPDATE">update</a> element, or 1180 * zero if it is absent. 1181 * 1182 * @return The value of the update element, or zero 1183 */ 1184 @Deprecated(since = "10") 1185 public int security() { 1186 return update(); 1187 } 1188 1189 /** 1190 * Returns an unmodifiable {@link java.util.List List} of the integers 1191 * represented in the <a href="#verNum">version number</a>. 1192 * The {@code List} always contains at least one element corresponding to 1193 * the <a href="#FEATURE">feature version number</a>. 1194 * 1195 * @return An unmodifiable list of the integers 1196 * represented in the version number 1197 */ 1198 public List<Integer> version() { 1199 return version; 1200 } 1201 1202 /** 1203 * Returns the optional <a href="#pre">pre-release</a> information. 1204 * 1205 * @return The optional pre-release information as a String 1206 */ 1207 public Optional<String> pre() { 1208 return pre; 1209 } 1210 1211 /** 1212 * Returns the <a href="#build">build number</a>. 1213 * |