Package com.wesabe.api.accounts.entities

Examples of com.wesabe.api.accounts.entities.Tag


    private SumOfMoney foodSpending, total;
    private Node foodNode;
   
    @Before
    public void setup() throws Exception {
      this.food = new Tag("food");
      this.foodSpending = new SumOfMoney(money("100.00", USD), 10);
      this.total = new SumOfMoney(money("100.00", USD), 10);
      this.foodNode = new Node(food, foodSpending, ImmutableList.<Node>of());
      this.hierarchy = new TagHierarchy(ImmutableList.of(foodNode), total);
    }
View Full Code Here


      assertEquals(rent.hashCode(), other.hashCode());
    }
   
    @Test
    public void itIsEqualToATagOfTheSameNameWithDifferentSplit() throws Exception {
      final Tag other = new Tag("rent:450");
      assertTrue(rent.equals(other));
      assertEquals(rent.hashCode(), other.hashCode());
    }
View Full Code Here

  }
 
  public static class A_Tag_Of_Only_Punctuation {
    @Test
    public void itIsEqualToItself() throws Exception {
      final Tag tag = new Tag("???__?");
      final Tag other = new Tag("???__?");
      assertTrue(tag.equals(other));
      assertEquals(tag.hashCode(), other.hashCode());
    }
View Full Code Here

      assertEquals(tag.hashCode(), other.hashCode());
    }
   
    @Test
    public void itIsEqualToItselfWithWhitespace() throws Exception {
      final Tag tag = new Tag("???__?");
      final Tag other = new Tag("???__   ?");
      assertTrue(tag.equals(other));
      assertEquals(tag.hashCode(), other.hashCode());
    }
View Full Code Here

  }
 
  public static class A_Tag_Of_Only_The_Letter_S {
    @Test
    public void itIsEqualToItself() throws Exception {
      final Tag tag = new Tag("s");
      final Tag other = new Tag("S");
      assertTrue(tag.equals(other));
      assertEquals(tag.hashCode(), other.hashCode());
    }
View Full Code Here

  }
 
  public static class A_Plural_Tag {
    @Test
    public void itIsEqualToAPluralVersionOfItself() throws Exception {
      final Tag tag = new Tag("cars");
      final Tag other = new Tag("car");
      assertTrue(tag.equals(other));
      assertEquals(tag.hashCode(), other.hashCode());
    }
View Full Code Here

    final Builder<Tag> tags = ImmutableSet.builder();
    final String uriPrefix = "/tags/";
    if (!tagUris.isEmpty()) {
      for (String uriParam : tagUris) {
        if (uriParam.startsWith(uriPrefix)) {
          tags.add(new Tag(uriParam.substring(uriPrefix.length())));
        }
      }
    }
   
    return tags.build();
View Full Code Here

    public void itFiltersTheTxactions() throws Exception {
      handleGet();
     
      verify(context.getTxactionListBuilder()).setCalculateBalances(false);
      verify(context.getTxactionListBuilder()).setUnedited(false);
      verify(context.getTxactionListBuilder()).setTags(ImmutableSet.of(new Tag("food")));
      verify(context.getTxactionListBuilder()).setAccounts(accounts);
      verify(context.getTxactionListBuilder()).setMerchantNames(merchantNames);
      verify(context.getTxactionListBuilder()).setQuery(query);
      verify(context.getTxactionListBuilder()).build(ImmutableList.of(txaction, filteredTxaction));
    }
View Full Code Here

         
          final List<TaggedAmount> taggedAmounts = txaction.getTaggedAmounts();
         
          if (taggedAmounts != null) {
            for (TaggedAmount taggedAmount : taggedAmounts) {
              final Tag tag = taggedAmount.getTag();
              if (tag != null && tag.toString().toLowerCase().contains(lowerQuery)) {
                return true;
              }
            }
          }
         
View Full Code Here

  public ImmutableMap<Tag, MonetarySummary> summarize(Iterable<Txaction> txactions, Currency currency) {
    final Multimap<Tag, Money> groupedAmounts = ArrayListMultimap.create();
    for (Txaction txaction : txactions) {
      if (isAnalyzable(txaction)) {
        for (TaggedAmount taggedAmount : txaction.getTaggedAmounts()) {
          final Tag tag = taggedAmount.getTag();
          final Money amount = taggedAmount.getConvertedAmount(currency, exchangeRateMap);
         
          groupedAmounts.put(tag, amount);
        }
      }
View Full Code Here

TOP

Related Classes of com.wesabe.api.accounts.entities.Tag

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.