当前位置: 首页>>代码示例>>Java>>正文


Java ExpirationDate类代码示例

本文整理汇总了Java中us.fatehi.creditcardnumber.ExpirationDate的典型用法代码示例。如果您正苦于以下问题:Java ExpirationDate类的具体用法?Java ExpirationDate怎么用?Java ExpirationDate使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ExpirationDate类属于us.fatehi.creditcardnumber包,在下文中一共展示了ExpirationDate类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: check

import us.fatehi.creditcardnumber.ExpirationDate; //导入依赖的package包/类
private void check(final YearMonth expectedExpirationDate,
                   final boolean isExpired)
{
  final String rawExpirationDate = formatter.format(expectedExpirationDate);
  final ExpirationDate expirationDate = new ExpirationDate(rawExpirationDate);
  assertEquals(rawExpirationDate, expirationDate.getRawData());
  assertTrue("Should have expiration date",
             expirationDate.hasExpirationDate());
  assertTrue(isExpired? expirationDate.isExpired()
                      : !expirationDate.isExpired());
  assertEquals(expectedExpirationDate, expirationDate.getExpirationDate());

  // System.out.println(String.format("%s - %s",
  // expectedExpirationDate,
  // expirationDate.getExpirationDateAsDate()));
}
 
开发者ID:sualeh,项目名称:credit_card_number,代码行数:17,代码来源:IsExpiredTest.java

示例2: Track2

import us.fatehi.creditcardnumber.ExpirationDate; //导入依赖的package包/类
private Track2(final String rawTrackData,
               final AccountNumber pan,
               final ExpirationDate expirationDate,
               final ServiceCode serviceCode,
               final String discretionaryData)
{
  super(rawTrackData, pan, expirationDate, serviceCode, discretionaryData);
}
 
开发者ID:IDPay,项目名称:magnetic-track-parser,代码行数:9,代码来源:Track2.java

示例3: Track1FormatB

import us.fatehi.creditcardnumber.ExpirationDate; //导入依赖的package包/类
private Track1FormatB(final String rawTrackData,
                      final AccountNumber pan,
                      final ExpirationDate expirationDate,
                      final Name name,
                      final ServiceCode serviceCode,
                      final String formatCode,
                      final String discretionaryData)
{
  super(rawTrackData, pan, expirationDate, serviceCode, discretionaryData);
  this.formatCode = formatCode;
  this.name = name;
}
 
开发者ID:IDPay,项目名称:magnetic-track-parser,代码行数:13,代码来源:Track1FormatB.java

示例4: BaseBankCardTrackData

import us.fatehi.creditcardnumber.ExpirationDate; //导入依赖的package包/类
BaseBankCardTrackData(final String rawTrackData,
                      final AccountNumber pan,
                      final ExpirationDate expirationDate,
                      final ServiceCode serviceCode,
                      final String discretionaryData)
{
  super(rawTrackData, discretionaryData);
  this.pan = pan;
  this.expirationDate = expirationDate;
  this.serviceCode = serviceCode;
}
 
开发者ID:IDPay,项目名称:magnetic-track-parser,代码行数:12,代码来源:BaseBankCardTrackData.java

示例5: main

import us.fatehi.creditcardnumber.ExpirationDate; //导入依赖的package包/类
public static void main(final String[] args)
{
  final AccountNumber pan = new AccountNumber("5266-0922-0141-6174");
  final ExpirationDate expiration = new ExpirationDate(2015, 4);
  final Name name = new Name("Sualeh", "Fatehi");
  final BankCard card = new BankCard(pan, expiration, name);
  System.out.println(card);
}
 
开发者ID:sualeh,项目名称:credit_card_number,代码行数:9,代码来源:SampleCode1.java

示例6: expirationDate_1

import us.fatehi.creditcardnumber.ExpirationDate; //导入依赖的package包/类
@Test
public void expirationDate_1()
{
  final String rawExpirationDate = null;
  final ExpirationDate expirationDate = new ExpirationDate(rawExpirationDate);
  assertEquals(rawExpirationDate, expirationDate.getRawData());
  assertTrue(!expirationDate.hasExpirationDate());
}
 
开发者ID:sualeh,项目名称:credit_card_number,代码行数:9,代码来源:ExpirationDateTest.java

示例7: expirationDate_2

import us.fatehi.creditcardnumber.ExpirationDate; //导入依赖的package包/类
@Test
public void expirationDate_2()
{
  final String rawExpirationDate = "\t\t";
  final ExpirationDate expirationDate = new ExpirationDate(rawExpirationDate);
  assertEquals(rawExpirationDate, expirationDate.getRawData());
  assertTrue("Should not have expiration date",
             !expirationDate.hasExpirationDate());
}
 
开发者ID:sualeh,项目名称:credit_card_number,代码行数:10,代码来源:ExpirationDateTest.java

示例8: expirationDate_3

import us.fatehi.creditcardnumber.ExpirationDate; //导入依赖的package包/类
@Test
public void expirationDate_3()
{
  final String rawExpirationDate = "AQW";
  final ExpirationDate expirationDate = new ExpirationDate(rawExpirationDate);
  assertEquals(rawExpirationDate, expirationDate.getRawData());
  assertTrue("Should not have expiration date",
             !expirationDate.hasExpirationDate());
}
 
开发者ID:sualeh,项目名称:credit_card_number,代码行数:10,代码来源:ExpirationDateTest.java

示例9: expirationDate_4

import us.fatehi.creditcardnumber.ExpirationDate; //导入依赖的package包/类
@Test
public void expirationDate_4()
{
  final String rawExpirationDate = "11";
  final ExpirationDate expirationDate = new ExpirationDate(rawExpirationDate);
  assertEquals(rawExpirationDate, expirationDate.getRawData());
  assertTrue("Should not have expiration date",
             !expirationDate.hasExpirationDate());
}
 
开发者ID:sualeh,项目名称:credit_card_number,代码行数:10,代码来源:ExpirationDateTest.java

示例10: expirationDate_5

import us.fatehi.creditcardnumber.ExpirationDate; //导入依赖的package包/类
@Test
public void expirationDate_5()
{
  final String rawExpirationDate = "8888";
  final ExpirationDate expirationDate = new ExpirationDate(rawExpirationDate);
  assertEquals(rawExpirationDate, expirationDate.getRawData());
  assertTrue("Should not have expiration date",
             !expirationDate.hasExpirationDate());
}
 
开发者ID:sualeh,项目名称:credit_card_number,代码行数:10,代码来源:ExpirationDateTest.java

示例11: expirationDate_6

import us.fatehi.creditcardnumber.ExpirationDate; //导入依赖的package包/类
@Test
public void expirationDate_6()
{
  final String rawExpirationDate = "121212";
  final ExpirationDate expirationDate = new ExpirationDate(rawExpirationDate);
  assertEquals(rawExpirationDate, expirationDate.getRawData());
  assertTrue("Should not have expiration date",
             !expirationDate.hasExpirationDate());
}
 
开发者ID:sualeh,项目名称:credit_card_number,代码行数:10,代码来源:ExpirationDateTest.java

示例12: expirationDate_7

import us.fatehi.creditcardnumber.ExpirationDate; //导入依赖的package包/类
@Test
public void expirationDate_7()
{
  final String rawExpirationDate = "1313";
  final ExpirationDate expirationDate = new ExpirationDate(rawExpirationDate);
  assertEquals(rawExpirationDate, expirationDate.getRawData());
  assertTrue("Should not have expiration date",
             !expirationDate.hasExpirationDate());
}
 
开发者ID:sualeh,项目名称:credit_card_number,代码行数:10,代码来源:ExpirationDateTest.java

示例13: expirationDate1

import us.fatehi.creditcardnumber.ExpirationDate; //导入依赖的package包/类
@Test
public void expirationDate1()
{
  final String rawExpirationDate = "1212";
  final ExpirationDate expirationDate = new ExpirationDate(rawExpirationDate);
  assertEquals(rawExpirationDate, expirationDate.getRawData());
  assertEquals("2012-12", expirationDate.toString());
  assertTrue("Should have expiration date",
             expirationDate.hasExpirationDate());
  assertEquals(YearMonth.of(2012, 12), expirationDate.getExpirationDate());
}
 
开发者ID:sualeh,项目名称:credit_card_number,代码行数:12,代码来源:ExpirationDateTest.java

示例14: getExpirationDate

import us.fatehi.creditcardnumber.ExpirationDate; //导入依赖的package包/类
/**
 * Gets the primary account number for the card.
 *
 * @return Primary account number.
 */
public ExpirationDate getExpirationDate()
{
  return expirationDate;
}
 
开发者ID:IDPay,项目名称:magnetic-track-parser,代码行数:10,代码来源:BaseBankCardTrackData.java


注:本文中的us.fatehi.creditcardnumber.ExpirationDate类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。