Skip to content

Package: VendorWithTwoPreconditions

VendorWithTwoPreconditions

nameinstructionbranchcomplexitylinemethod
VendorWithTwoPreconditions()
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
VendorWithTwoPreconditions(int)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
bid()
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2018 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * jonas - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.bazaar.internal;
15:
16: import org.eclipse.emfforms.bazaar.Bid;
17: import org.eclipse.emfforms.bazaar.Precondition;
18: import org.eclipse.emfforms.bazaar.Preconditions;
19: import org.eclipse.emfforms.bazaar.Vendor;
20:
21: /**
22: * @author jonas
23: *
24: */
25: @Preconditions(preconditions = {
26:         @Precondition(key = VendorWithTwoPreconditions.KEY1, value = VendorWithTwoPreconditions.VALUE1),
27:         @Precondition(key = VendorWithTwoPreconditions.KEY2, value = VendorWithTwoPreconditions.VALUE2) })
28: public class VendorWithTwoPreconditions implements Vendor<MyProduct> {
29:
30:         private final int priority;
31:
32:         /**
33:          * Constructor specifying a priority
34:          *
35:          * @param priority the priority returned on {@link Bid}
36:          */
37:         public VendorWithTwoPreconditions(int priority) {
38:                 this.priority = priority;
39:         }
40:
41:         /**
42:          *
43:          */
44:         public VendorWithTwoPreconditions() {
45:                 priority = 0;
46:         }
47:
48:         static final String VALUE1 = "value"; //$NON-NLS-1$
49:         static final String KEY1 = "key"; //$NON-NLS-1$
50:         static final String VALUE2 = "value1"; //$NON-NLS-1$
51:         static final String KEY2 = "key1"; //$NON-NLS-1$
52:
53:         @Bid
54:         public double bid() {
55:                 return priority;
56:         }
57: }