File tree Expand file tree Collapse file tree
main/java/javax/measure/spi
test/java/javax/measure/spi Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3636 *
3737 * @author <a href="mailto:units@catmedia.us">Werner Keil</a>
3838 * @author <a href="mailto:otaviojava@java.net">Otavio Santana</a>
39- * @version 0.2
39+ * @version 0.3
40+ * @deprecated Factory provided by {@link ServiceProvider} directly
4041 */
4142public interface QuantityFactoryService {
4243
Original file line number Diff line number Diff line change 4444 * <p>
4545 * All the methods in this class are safe for use by multiple concurrent threads.
4646 *
47- * @version 0.8.2, April 1 , 2016
47+ * @version 0.9, May 11 , 2016
4848 * @author Werner Keil
4949 * @author Martin Desruisseaux
5050 */
@@ -94,9 +94,19 @@ public int getPriority() {
9494 * Returns the service to obtain a {@link Quantity}, or {@code null} if none.
9595 *
9696 * @return the service to obtain a {@link Quantity}, or {@code null}.
97+ * @deprecated use {@link #getQuantityFactory(Class)} instead
9798 */
9899 public abstract QuantityFactoryService getQuantityFactoryService ();
99100
101+ /**
102+ * Return a factory for this {@link Quantity}.
103+ *
104+ * @param quantity
105+ * the quantity
106+ * @return the {@link QuantityFactory}
107+ */
108+ public abstract <Q extends Quantity <Q >> QuantityFactory <Q > getQuantityFactory (Class <Q > quantity );
109+
100110 /**
101111 * Gets all {@link ServiceProvider}. This method loads the provider when first needed.
102112 */
Original file line number Diff line number Diff line change 3333
3434import static org .junit .Assert .*;
3535
36+ import javax .measure .Quantity ;
37+
3638/**
3739 * Tests for {@link ServiceProvider}.
3840 */
@@ -79,5 +81,10 @@ public UnitFormatService getUnitFormatService() {
7981 public QuantityFactoryService getQuantityFactoryService () {
8082 return null ;
8183 }
84+
85+ @ Override
86+ public <Q extends Quantity <Q >> QuantityFactory <Q > getQuantityFactory (Class <Q > quantity ) {
87+ return null ;
88+ }
8289 }
8390}
You can’t perform that action at this time.
0 commit comments