热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.killbill.billing.account.api.Account类的使用及代码示例

本文整理了Java中org.killbill.billing.account.api.Account类的一些代码示例,展示了Account类的

本文整理了Java中org.killbill.billing.account.api.Account类的一些代码示例,展示了Account类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Account类的具体详情如下:
包路径:org.killbill.billing.account.api.Account
类名称:Account

Account介绍

[英]The interface Account represents an account within Killbill.

An Account has a unique UUID and also an externalKey that it set when it is created. The billCycleDay can be specified when creating the account, or it will be set automatically by the system.
[中]

代码示例

代码示例来源:origin: killbill/killbill

@Test(groups = "slow", expectedExceptiOns= IllegalArgumentException.class, description = "Test updating Account externalKey throws an exception")
public void testShouldntBeAbleToUpdateExternalKey() throws Exception {
final Account account = createAccount(new DefaultAccount(createTestAccount()));
final MutableAccountData otherAccount = new DefaultAccount(account.getId(), account).toMutableAccountData();
otherAccount.setExternalKey(UUID.randomUUID().toString());
accountUserApi.updateAccount(new DefaultAccount(account.getId(), otherAccount), callContext);
}

代码示例来源:origin: killbill/killbill

@Test(groups = "slow", description = "Test Account update with null values")
public void testShouldBeAbleToPassNullForSomeFieldsToAvoidUpdate() throws Exception {
final Account account = createAccount(new DefaultAccount(createTestAccount()));
// Update the address and leave other fields null
final MutableAccountData mutableAccountData = new DefaultMutableAccountData(null, null, null, 0, null, null, false, 0, null,
clock.getUTCNow(), null, null, null, null, null, null,
null, null, null, null, null, false);
final String newAddress1 = UUID.randomUUID().toString();
mutableAccountData.setAddress1(newAddress1);
accountUserApi.updateAccount(account.getId(), mutableAccountData, callContext);
final Account retrievedAccount = accountUserApi.getAccountById(account.getId(), callContext);
Assert.assertEquals(retrievedAccount.getAddress1(), newAddress1);
Assert.assertEquals(retrievedAccount.getAddress2(), account.getAddress2());
Assert.assertEquals(retrievedAccount.getCurrency(), account.getCurrency());
Assert.assertEquals(retrievedAccount.getExternalKey(), account.getExternalKey());
Assert.assertEquals(retrievedAccount.getBillCycleDayLocal(), account.getBillCycleDayLocal());
}

代码示例来源:origin: killbill/killbill

public Account createAccount(final LocalDate dateOfLastUnPaidInvoice) throws SubscriptionBaseApiException, AccountApiException {
final UUID accountId = UUID.randomUUID();
final Account account = Mockito.mock(Account.class);
Mockito.when(account.getId()).thenReturn(accountId);
Mockito.when(account.getTimeZone()).thenReturn(DateTimeZone.UTC);
Mockito.when(accountInternalApi.getAccountById(Mockito.eq(account.getId()), Mockito.any())).thenReturn(account);
final Invoice invoice = Mockito.mock(Invoice.class);
Mockito.when(invoice.getInvoiceDate()).thenReturn(dateOfLastUnPaidInvoice);
Mockito.when(invoice.getBalance()).thenReturn(BigDecimal.TEN);
Mockito.when(invoice.getStatus()).thenReturn(InvoiceStatus.COMMITTED);
Mockito.when(invoice.getId()).thenReturn(UUID.randomUUID());
final InvoiceItem item = Mockito.mock(InvoiceItem.class);
final List items = new ArrayList();
items.add(item);
Mockito.when(invoice.getInvoiceItems()).thenReturn(items);
final List invoices = new ArrayList();
invoices.add(invoice);
Mockito.when(invoiceInternalApi.getUnpaidInvoicesByAccountId(Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(invoices);
final Tag tag = Mockito.mock(Tag.class);
Mockito.when(tag.getObjectId()).thenReturn(accountId);
Mockito.when(tag.getObjectType()).thenReturn(ObjectType.ACCOUNT);
Mockito.when(tag.getTagDefinitionId()).thenReturn(ControlTagType.TEST.getId());
final List tags = new ArrayList();
tags.add(tag);
Mockito.when(tagInternalApi.getTags(Mockito.eq(account.getId()), Mockito.eq(ObjectType.ACCOUNT), Mockito.any()))
.thenReturn(tags);
return account;
}

代码示例来源:origin: killbill/killbill

public DefaultImmutableAccountData(final Account account) {
this(account.getId(),
account.getExternalKey(),
account.getCurrency(),
account.getTimeZone(),
AccountDateTimeUtils.getFixedOffsetTimeZone(account),
account.getReferenceTime());
}

代码示例来源:origin: killbill/killbill

public static DateTimeZone getFixedOffsetTimeZone(final Account account) {
return getFixedOffsetTimeZone(account.getTimeZone(), account.getReferenceTime());
}

代码示例来源:origin: killbill/killbill

currentAccount.getExternalKey() != null &&
!currentAccount.getExternalKey().equals(externalKey)) {
throw new IllegalArgumentException(String.format("Killbill doesn't support updating the account external key yet: new=%s, current=%s",
externalKey, currentAccount.getExternalKey()));
currentAccount.getCurrency() != null &&
!currentAccount.getCurrency().equals(currency)) {
throw new IllegalArgumentException(String.format("Killbill doesn't support updating the account currency yet: new=%s, current=%s",
currency, currentAccount.getCurrency()));
currentAccount.getBillCycleDayLocal() != DEFAULT_BILLING_CYCLE_DAY_LOCAL && // There is already a BCD set
!currentAccount.getBillCycleDayLocal().equals(billCycleDayLocal)) { // and it does not match we we have
throw new IllegalArgumentException(String.format("Killbill doesn't support updating the account BCD yet: new=%s, current=%s", billCycleDayLocal, currentAccount.getBillCycleDayLocal()));
currentAccount.getTimeZone() != null &&
!currentAccount.getTimeZone().equals(timeZone)) {
throw new IllegalArgumentException(String.format("Killbill doesn't support updating the account timeZone yet: new=%s, current=%s",
timeZone, currentAccount.getTimeZone()));
if (referenceTime != null && currentAccount.getReferenceTime().withMillisOfDay(0).compareTo(referenceTime.withMillisOfDay(0)) != 0) {
throw new IllegalArgumentException(String.format("Killbill doesn't support updating the account referenceTime yet: new=%s, current=%s",
referenceTime, currentAccount.getReferenceTime()));

代码示例来源:origin: org.kill-bill.billing/killbill-invoice

@Test(groups = "slow")
public void testAccountBalanceWithNoInvoiceItems() throws EntityPersistenceException {
final UUID accountId = account.getId();
final LocalDate targetDate1 = new LocalDate(2011, 10, 6);
final Invoice invoice1 = new DefaultInvoice(accountId, clock.getUTCToday(), targetDate1, Currency.USD);
invoiceUtil.createInvoice(invoice1, context);
final BigDecimal payment1 = new BigDecimal("48.0");
final InvoicePayment payment = new DefaultInvoicePayment(InvoicePaymentType.ATTEMPT, UUID.randomUUID(), invoice1.getId(), new DateTime(), payment1, Currency.USD, Currency.USD, null, true);
invoiceUtil.createPayment(payment, context);
final BigDecimal balance = invoiceDao.getAccountBalance(accountId, context);
assertEquals(balance.compareTo(BigDecimal.ZERO.subtract(payment1)), 0);
}

代码示例来源:origin: org.kill-bill.billing/killbill-payment

@Test(groups = "slow")
public void testSimpleAuthCaptureWithInvalidPaymentId() throws Exception {
final BigDecimal requestedAmount = new BigDecimal("80.0091");
final Payment initialPayment = paymentApi.createAuthorization(account, account.getPaymentMethodId(), null, requestedAmount, account.getCurrency(), null,
UUID.randomUUID().toString(), UUID.randomUUID().toString(), ImmutableList.of(), callContext);
try {
paymentApi.createCapture(account, UUID.randomUUID(), requestedAmount, account.getCurrency(), null, UUID.randomUUID().toString(), ImmutableList.of(), callContext);
Assert.fail("Expected capture to fail...");
} catch (final PaymentApiException e) {
Assert.assertEquals(e.getCode(), ErrorCode.PAYMENT_NO_SUCH_PAYMENT.getCode());
final Payment latestPayment = paymentApi.getPayment(initialPayment.getId(), true, false, ImmutableList.of(), callContext);
assertEquals(latestPayment, initialPayment);
}
}

代码示例来源:origin: org.kill-bill.billing/killbill-invoice

@Test(groups = "slow")
public void testGetInvoiceItemsBySubscriptionId() throws EntityPersistenceException {
final UUID accountId = account.getId();
final UUID subscriptiOnId= UUID.randomUUID();
final UUID bundleId = UUID.randomUUID();
final LocalDate startDate = new LocalDate(2011, 3, 1);
final BigDecimal rate = new BigDecimal("20.00");
for (int i = 0; i <3; i++) {
final UUID invoiceId = UUID.randomUUID();
final RecurringInvoiceItem item = new RecurringInvoiceItem(invoiceId, accountId, bundleId, subscriptionId,
"test product", "test plan", "test phase", startDate.plusMonths(i), startDate.plusMonths(i + 1),
rate, rate, Currency.USD);
invoiceUtil.createInvoiceItem(item, context);
}
final List items = invoiceUtil.getInvoiceItemBySubscriptionId(subscriptionId, context);
assertEquals(items.size(), 3);
}

代码示例来源:origin: org.kill-bill.billing/killbill-invoice

@Test(groups = "slow")
public void testInvoicePayment() throws InvoiceApiException, EntityPersistenceException {
final UUID accountId = account.getId();
final Invoice invoice = new DefaultInvoice(accountId, clock.getUTCToday(), clock.getUTCToday(), Currency.USD);
final UUID invoiceId = invoice.getId();
final UUID subscriptiOnId= UUID.randomUUID();
final UUID bundleId = UUID.randomUUID();
final LocalDate startDate = new LocalDate(2010, 1, 1);
final LocalDate endDate = new LocalDate(2010, 4, 1);
final InvoiceItem invoiceItem = new RecurringInvoiceItem(invoiceId, accountId, bundleId, subscriptionId, "test product", "test plan", "test phase", startDate, endDate,
new BigDecimal("21.00"), new BigDecimal("7.00"), Currency.USD);
invoice.addInvoiceItem(invoiceItem);
invoiceUtil.createInvoice(invoice, context);
final InvoiceModelDao savedInvoice = invoiceDao.getById(invoiceId, context);
assertNotNull(savedInvoice);
assertEquals(InvoiceModelDaoHelper.getRawBalanceForRegularInvoice(savedInvoice).compareTo(new BigDecimal("21.00")), 0);
assertEquals(savedInvoice.getInvoiceItems().size(), 1);
final BigDecimal paymentAmount = new BigDecimal("11.00");
final UUID paymentId = UUID.randomUUID();
final DefaultInvoicePayment defaultInvoicePayment = new DefaultInvoicePayment(InvoicePaymentType.ATTEMPT, paymentId, invoiceId, clock.getUTCNow().plusDays(12), paymentAmount, Currency.USD, Currency.USD, "COOKIE", true);
invoiceDao.notifyOfPaymentCompletion(new InvoicePaymentModelDao(defaultInvoicePayment), context);
final InvoiceModelDao retrievedInvoice = invoiceDao.getById(invoiceId, context);
assertNotNull(retrievedInvoice);
assertEquals(retrievedInvoice.getInvoiceItems().size(), 1);
assertEquals(InvoiceModelDaoHelper.getRawBalanceForRegularInvoice(retrievedInvoice).compareTo(new BigDecimal("10.00")), 0);
}

代码示例来源:origin: killbill/killbill

@Test(groups = "fast", description = "Test Account BCD merge")
public void testBCDMerges() throws Exception {
final UUID accountId = UUID.randomUUID();
final Currency currency = Currency.BRL;
final String externalKey = UUID.randomUUID().toString();
Assert.assertEquals(accountWithNullBCD.getBillCycleDayLocal(), (Integer) 0);
final Account accountWithZeroBCD = new DefaultAccount(accountId, accountDataWithZeroBCD);
Assert.assertEquals(accountWithNullBCD.mergeWithDelegate(accountWithZeroBCD).getBillCycleDayLocal(), (Integer) 0);
final Account accountWithRealBCD = new DefaultAccount(accountId, accountDataWithRealBCD);
Assert.assertEquals(accountWithNullBCD.mergeWithDelegate(accountWithRealBCD).getBillCycleDayLocal(), (Integer) 12);
final Account accountWithAnotherBCD = new DefaultAccount(accountId, accountDataWithAnotherRealBCD);
Assert.assertEquals(accountWithAnotherBCD.mergeWithDelegate(accountWithAnotherBCD).getBillCycleDayLocal(), (Integer) 20);
try {
Assert.assertEquals(accountWithAnotherBCD.mergeWithDelegate(accountWithRealBCD).getBillCycleDayLocal(), (Integer) 20);
Assert.fail();
} catch (final IllegalArgumentException e) {

代码示例来源:origin: org.kill-bill.billing/killbill-invoice

private void createAndVerifyExternalCharge(final BigDecimal amount, final Currency currency) throws EntityPersistenceException {
final InvoiceItem externalChargeInvoiceItem = new ExternalChargeInvoiceItem(UUID.randomUUID(), account.getId(), UUID.randomUUID(),
UUID.randomUUID().toString(), new LocalDate(2012, 4, 1), new LocalDate(2012, 5, 1), amount, currency, null);
invoiceUtil.createInvoiceItem(externalChargeInvoiceItem, context);
final InvoiceItemModelDao savedItem = invoiceUtil.getInvoiceItemById(externalChargeInvoiceItem.getId(), context);
assertSameInvoiceItem(externalChargeInvoiceItem, savedItem);
Assert.assertEquals(externalChargeInvoiceItem.getAmount().compareTo(amount), 0);
}

代码示例来源:origin: org.kill-bill.billing/killbill-payment

@Test(groups = "fast")
public void testPaymentMethodExternalKeySetByPluginIfNonSpecified() throws Exception {
final Account account = Mockito.mock(Account.class);
final UUID accountId = UUID.randomUUID();
Mockito.when(account.getId()).thenReturn(accountId);
Mockito.when(account.getExternalKey()).thenReturn(accountId.toString());
final PaymentMethodPlugin paymentMethodPlugin = Mockito.mock(PaymentMethodPlugin.class);
final Iterable properties = ImmutableList.of();
// By default, the external payment plugin sets the external payment method id to "unknown"
final UUID paymentMethodId2 = paymentMethodProcessor.addPaymentMethod(null, "__EXTERNAL_PAYMENT__", account, false, paymentMethodPlugin, properties, callContext, internalCallContext);
final PaymentMethod paymentMethod2 = paymentMethodProcessor.getPaymentMethodById(paymentMethodId2, false, false, properties, callContext, internalCallContext);
Assert.assertEquals(paymentMethod2.getExternalKey(), "unknown");
}

代码示例来源:origin: org.kill-bill.billing.plugin.java/killbill-base-plugin

public static Account buildAccount(final Currency currency, final String address1, final String address2, final String city, final String stateOrProvince, final String postalCode, final String country) {
final Account account = Mockito.mock(Account.class);
Mockito.when(account.getId()).thenReturn(UUID.randomUUID());
Mockito.when(account.getExternalKey()).thenReturn(UUID.randomUUID().toString());
Mockito.when(account.getName()).thenReturn(UUID.randomUUID().toString());
Mockito.when(account.getFirstNameLength()).thenReturn(4);
Mockito.when(account.getEmail()).thenReturn(UUID.randomUUID().toString());
Mockito.when(account.getBillCycleDayLocal()).thenReturn(2);
Mockito.when(account.getCurrency()).thenReturn(currency);
Mockito.when(account.getPaymentMethodId()).thenReturn(UUID.randomUUID());
Mockito.when(account.getTimeZone()).thenReturn(DateTimeZone.getDefault());
// Return language tag to be able to use Locale.forLanguageTag
Mockito.when(account.getLocale()).thenReturn("en-US");
Mockito.when(account.getAddress1()).thenReturn(address1);
Mockito.when(account.getAddress2()).thenReturn(address2);
Mockito.when(account.getCompanyName()).thenReturn(UUID.randomUUID().toString());
Mockito.when(account.getCity()).thenReturn(city);
Mockito.when(account.getStateOrProvince()).thenReturn(stateOrProvince);
Mockito.when(account.getPostalCode()).thenReturn(postalCode);
Mockito.when(account.getCountry()).thenReturn(country);
Mockito.when(account.getPhone()).thenReturn(UUID.randomUUID().toString().substring(0, 25));
Mockito.when(account.isMigrated()).thenReturn(true);
Mockito.when(account.getCreatedDate()).thenReturn(new DateTime(2016, 1, 22, 10, 56, 47, DateTimeZone.UTC));
Mockito.when(account.getUpdatedDate()).thenReturn(new DateTime(2016, 1, 22, 10, 56, 48, DateTimeZone.UTC));
return account;
}

代码示例来源:origin: org.kill-bill.billing/killbill-payment

public Account createTestAccount(final String email, final boolean addPaymentMethod) throws Exception {
final String name = "First" + UUID.randomUUID().toString() + " " + "Last" + UUID.randomUUID().toString();
final String externalKey = UUID.randomUUID().toString();
Mockito.when(accountData.getId()).thenReturn(UUID.randomUUID());
Mockito.when(accountData.getExternalKey()).thenReturn(externalKey);
Mockito.when(accountData.getName()).thenReturn(name);
Mockito.when(accountData.getFirstNameLength()).thenReturn(10);
Mockito.when(accountData.getPhone()).thenReturn("123-456-7890");
Mockito.when(accountData.getEmail()).thenReturn(email);
Mockito.when(accountData.getCurrency()).thenReturn(Currency.USD);
Mockito.when(accountData.getBillCycleDayLocal()).thenReturn(1);
Mockito.when(accountData.isMigrated()).thenReturn(false);
Mockito.when(accountData.getTimeZone()).thenReturn(DateTimeZone.UTC);
final DateTime utcNow = clock.getUTCNow();
Mockito.when(accountData.getCreatedDate()).thenReturn(utcNow);
Mockito.when(accountData.getReferenceTime()).thenReturn(utcNow);
GuicyKillbillTestSuite.refreshCallContext(account.getId(), clock, internalCallContextFactory, mutableCallContext, internalCallContext);

代码示例来源:origin: killbill/killbill

@Test(groups = "slow")
public void testShouldntInsertMultipleNotificationsPerOverdueable() throws Exception {
final UUID accountId = UUID.randomUUID();
final Account overdueable = Mockito.mock(Account.class);
Mockito.when(overdueable.getId()).thenReturn(accountId);
insertOverdueCheckAndVerifyQueueContent(overdueable, 10, 10);
insertOverdueCheckAndVerifyQueueContent(overdueable, 5, 5);
insertOverdueCheckAndVerifyQueueContent(overdueable, 15, 5);
// Verify the final content of the queue
Assert.assertEquals(Iterables.size(overdueQueue.getFutureNotificationForSearchKeys(internalCallContext.getAccountRecordId(), internalCallContext.getTenantRecordId())), 1);
}

代码示例来源:origin: org.kill-bill.billing/killbill-invoice

@Test(groups = "fast")
public void testProcessFixedBillingEventsWithCancellationOnNextDay() throws InvoiceApiException {
final LocalDate targetDate = new LocalDate("2016-01-08");
final UUID invoiceId = UUID.randomUUID();
final BillingEventSet events = new MockBillingEventSet();
final BigDecimal fixedPriceAmount = BigDecimal.TEN;
final MockInternationalPrice fixedPrice = new MockInternationalPrice(new DefaultPrice(fixedPriceAmount, Currency.USD));
final Plan plan = new MockPlan("my-plan");
final PlanPhase phase = new MockPlanPhase(null, fixedPrice, BillingPeriod.NO_BILLING_PERIOD, PhaseType.TRIAL);
final BillingEvent event1 = invoiceUtil.createMockBillingEvent(account, subscription, new DateTime("2016-01-08"),
plan, phase,
fixedPriceAmount, null, Currency.USD, BillingPeriod.NO_BILLING_PERIOD, 1,
BillingMode.IN_ADVANCE, "Billing Event Desc", 1L,
SubscriptionBaseTransitionType.CREATE);
events.add(event1);
final BillingEvent event2 = invoiceUtil.createMockBillingEvent(account, subscription, new DateTime("2016-01-09"),
plan, phase,
null, null, Currency.USD, BillingPeriod.NO_BILLING_PERIOD, 1,
BillingMode.IN_ADVANCE, "Billing Event Desc", 2L,
SubscriptionBaseTransitionType.CANCEL);
events.add(event2);
final List proposedItems = new ArrayList();
fixedAndRecurringInvoiceItemGenerator.processFixedBillingEvents(invoiceId, account.getId(), events, targetDate, Currency.USD, proposedItems, internalCallContext);
assertEquals(proposedItems.size(), 1);
assertEquals(proposedItems.get(0).getInvoiceItemType(), InvoiceItemType.FIXED);
assertEquals(proposedItems.get(0).getAmount().compareTo(fixedPriceAmount), 0);
}

代码示例来源:origin: org.kill-bill.billing/killbill-invoice

@Test(groups = "slow")
public void testGetByInvoiceItemId() throws EntityPersistenceException, InvoiceApiException {
final Invoice invoice1 = new DefaultInvoice(account.getId(), clock.getUTCToday(), clock.getUTCToday(), Currency.USD);
invoiceUtil.createInvoice(invoice1, context);
final UUID invoiceId1 = invoice1.getId();
LocalDate startDate = new LocalDate(2011, 3, 1);
LocalDate endDate = startDate.plusMonths(1);
final RecurringInvoiceItem recurringItem1 = new RecurringInvoiceItem(invoiceId1, account.getId(), UUID.randomUUID(), UUID.randomUUID(), "test product", "test plan", "test A", startDate, endDate,
BigDecimal.ONE, BigDecimal.ONE, Currency.USD);
invoiceUtil.createInvoiceItem(recurringItem1, context);
final InvoiceModelDao targetInvoice = invoiceDao.getByInvoiceItem(recurringItem1.getId(), internalCallContext);
assertNotNull(targetInvoice);
assertEquals(targetInvoice.getId(), invoiceId1);
assertEquals(targetInvoice.getInvoiceItems().size(), 1);
assertEquals(targetInvoice.getInvoiceItems().get(0).getId(), recurringItem1.getId());
}

代码示例来源:origin: killbill/killbill

public void clear(final DateTime effectiveDate, final InternalCallContext context) throws OverdueException, OverdueApiException {
GlobalLock lock = null;
try {
lock = locker.lockWithNumberOfTries(LockerType.ACCNT_INV_PAY.toString(), overdueable.getId().toString(), MAX_LOCK_RETRIES);
clearWithLock(effectiveDate, context);
} catch (final LockFailedException e) {
log.warn("Failed to clear overdue for accountId='{}'", overdueable.getId(), e);
} finally {
if (lock != null) {
lock.release();
}
}
}

代码示例来源:origin: org.kill-bill.billing/killbill-invoice

@Test(groups = "slow")
public void testCreateParentInvoice() throws InvoiceApiException {
final UUID parentAccountId = UUID.randomUUID();
final UUID childAccountId = UUID.randomUUID();
final DateTime today = clock.getNow(account.getTimeZone());
InvoiceModelDao parentInvoice = new InvoiceModelDao(parentAccountId, today.toLocalDate(), account.getCurrency(), InvoiceStatus.DRAFT, true);
InvoiceItem parentInvoiceItem = new ParentInvoiceItem(UUID.randomUUID(), today, parentInvoice.getId(), parentAccountId, childAccountId, BigDecimal.TEN, account.getCurrency(), "");
parentInvoice.addInvoiceItem(new InvoiceItemModelDao(parentInvoiceItem));
invoiceDao.createInvoices(ImmutableList.of(parentInvoice), ImmutableSet.of(), context);
final InvoiceModelDao parentDraftInvoice = invoiceDao.getParentDraftInvoice(parentAccountId, context);
assertNotNull(parentDraftInvoice);
assertEquals(parentDraftInvoice.getStatus(), InvoiceStatus.DRAFT);
assertEquals(parentDraftInvoice.getInvoiceItems().size(), 1);
}

推荐阅读
  • Java容器中的compareto方法排序原理解析
    本文从源码解析Java容器中的compareto方法的排序原理,讲解了在使用数组存储数据时的限制以及存储效率的问题。同时提到了Redis的五大数据结构和list、set等知识点,回忆了作者大学时代的Java学习经历。文章以作者做的思维导图作为目录,展示了整个讲解过程。 ... [详细]
  • 如何自行分析定位SAP BSP错误
    The“BSPtag”Imentionedintheblogtitlemeansforexamplethetagchtmlb:configCelleratorbelowwhichi ... [详细]
  • Java太阳系小游戏分析和源码详解
    本文介绍了一个基于Java的太阳系小游戏的分析和源码详解。通过对面向对象的知识的学习和实践,作者实现了太阳系各行星绕太阳转的效果。文章详细介绍了游戏的设计思路和源码结构,包括工具类、常量、图片加载、面板等。通过这个小游戏的制作,读者可以巩固和应用所学的知识,如类的继承、方法的重载与重写、多态和封装等。 ... [详细]
  • 本文介绍了一个Java猜拳小游戏的代码,通过使用Scanner类获取用户输入的拳的数字,并随机生成计算机的拳,然后判断胜负。该游戏可以选择剪刀、石头、布三种拳,通过比较两者的拳来决定胜负。 ... [详细]
  • JavaSE笔试题-接口、抽象类、多态等问题解答
    本文解答了JavaSE笔试题中关于接口、抽象类、多态等问题。包括Math类的取整数方法、接口是否可继承、抽象类是否可实现接口、抽象类是否可继承具体类、抽象类中是否可以有静态main方法等问题。同时介绍了面向对象的特征,以及Java中实现多态的机制。 ... [详细]
  • Spring特性实现接口多类的动态调用详解
    本文详细介绍了如何使用Spring特性实现接口多类的动态调用。通过对Spring IoC容器的基础类BeanFactory和ApplicationContext的介绍,以及getBeansOfType方法的应用,解决了在实际工作中遇到的接口及多个实现类的问题。同时,文章还提到了SPI使用的不便之处,并介绍了借助ApplicationContext实现需求的方法。阅读本文,你将了解到Spring特性的实现原理和实际应用方式。 ... [详细]
  • JVM 学习总结(三)——对象存活判定算法的两种实现
    本文介绍了垃圾收集器在回收堆内存前确定对象存活的两种算法:引用计数算法和可达性分析算法。引用计数算法通过计数器判定对象是否存活,虽然简单高效,但无法解决循环引用的问题;可达性分析算法通过判断对象是否可达来确定存活对象,是主流的Java虚拟机内存管理算法。 ... [详细]
  • 个人学习使用:谨慎参考1Client类importcom.thoughtworks.gauge.Step;importcom.thoughtworks.gauge.T ... [详细]
  • 本文详细介绍了Java中vector的使用方法和相关知识,包括vector类的功能、构造方法和使用注意事项。通过使用vector类,可以方便地实现动态数组的功能,并且可以随意插入不同类型的对象,进行查找、插入和删除操作。这篇文章对于需要频繁进行查找、插入和删除操作的情况下,使用vector类是一个很好的选择。 ... [详细]
  • Java学习笔记之面向对象编程(OOP)
    本文介绍了Java学习笔记中的面向对象编程(OOP)内容,包括OOP的三大特性(封装、继承、多态)和五大原则(单一职责原则、开放封闭原则、里式替换原则、依赖倒置原则)。通过学习OOP,可以提高代码复用性、拓展性和安全性。 ... [详细]
  • 先看官方文档TheJavaTutorialshavebeenwrittenforJDK8.Examplesandpracticesdescribedinthispagedontta ... [详细]
  • JDK源码学习之HashTable(附带面试题)的学习笔记
    本文介绍了JDK源码学习之HashTable(附带面试题)的学习笔记,包括HashTable的定义、数据类型、与HashMap的关系和区别。文章提供了干货,并附带了其他相关主题的学习笔记。 ... [详细]
  • 重入锁(ReentrantLock)学习及实现原理
    本文介绍了重入锁(ReentrantLock)的学习及实现原理。在学习synchronized的基础上,重入锁提供了更多的灵活性和功能。文章详细介绍了重入锁的特性、使用方法和实现原理,并提供了类图和测试代码供读者参考。重入锁支持重入和公平与非公平两种实现方式,通过对比和分析,读者可以更好地理解和应用重入锁。 ... [详细]
  • 本文介绍了如何在给定的有序字符序列中插入新字符,并保持序列的有序性。通过示例代码演示了插入过程,以及插入后的字符序列。 ... [详细]
  • 1,关于死锁的理解死锁,我们可以简单的理解为是两个线程同时使用同一资源,两个线程又得不到相应的资源而造成永无相互等待的情况。 2,模拟死锁背景介绍:我们创建一个朋友 ... [详细]
author-avatar
mobiledu2502871703
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有