• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

iluwatar / java-design-patterns / #1677

07 Jun 2016 07:32PM UTC coverage: 89.079% (-0.5%) from 89.611%
#1677

push

iluwatar
Merge pull request #433 from qza/master

Abstract Document

48 of 48 new or added lines in 8 files covered. (100.0%)

18 existing lines in 4 files now uncovered.

5049 of 5668 relevant lines covered (89.08%)

0.89 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

81.82
/semaphore/src/main/java/com/iluwatar/semaphore/Fruit.java
1
/**
2
 * The MIT License
3
 * Copyright (c) 2014 Ilkka Seppälä
4
 *
5
 * Permission is hereby granted, free of charge, to any person obtaining a copy
6
 * of this software and associated documentation files (the "Software"), to deal
7
 * in the Software without restriction, including without limitation the rights
8
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
 * copies of the Software, and to permit persons to whom the Software is
10
 * furnished to do so, subject to the following conditions:
11
 *
12
 * The above copyright notice and this permission notice shall be included in
13
 * all copies or substantial portions of the Software.
14
 *
15
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
 * THE SOFTWARE.
22
 */
23
package com.iluwatar.semaphore;
24

25
/**
26
 * Fruit is a resource stored in a FruitBowl. 
27
 */
28
public class Fruit {
29

30
  public static enum FruitType {
1✔
31
    ORANGE, APPLE, LEMON
1✔
32
  }
33
    
34
  private FruitType type;
35
    
36
  public Fruit(FruitType type) {
1✔
37
    this.type = type;
1✔
38
  }
1✔
39
    
40
  public FruitType getType() {
UNCOV
41
    return type;
×
42
  }
43
  
44
  /**
45
   * toString method
46
   */ 
47
  public String toString() {
48
    switch (type) {
1✔
49
      case ORANGE:
50
        return "Orange";
1✔
51
      case APPLE: 
52
        return "Apple";
1✔
53
      case LEMON: 
54
        return "Lemon";
1✔
55
      default: 
56
        return "";
×
57
    }
58
  }
59

60
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc