本文整理汇总了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()));
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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());
}
示例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;
}