Skip to content

Commit

Permalink
write a line into test.file
Browse files Browse the repository at this point in the history
  • Loading branch information
huifer committed Dec 15, 2023
1 parent 02bf728 commit fc12a76
Show file tree
Hide file tree
Showing 5 changed files with 530 additions and 0 deletions.
84 changes: 84 additions & 0 deletions docs/spring/cs50203e2c-9aea-11ee-947e-acde48001122.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/**
* Copyright 2009-2017 the original author or authors.
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ibatis.reflection.property;

import java.util.Iterator;

/**
* @author Clinton Begin
*/
public class PropertyTokenizer implements Iterator<PropertyTokenizer> {
private final String indexedName;
private final String children;
private String name;
private String index;


/**
* 数据初始化
*
* @param fullname
*/
public PropertyTokenizer(String fullname) {
// 分割 .
int delim = fullname.indexOf('.');
if (delim > -1) {
name = fullname.substring(0, delim);
children = fullname.substring(delim + 1);
} else {
name = fullname;
children = null;
}
indexedName = name;
// 分割[
delim = name.indexOf('[');
if (delim > -1) {
index = name.substring(delim + 1, name.length() - 1);
name = name.substring(0, delim);
}
}

public String getName() {
return name;
}

public String getIndex() {
return index;
}

public String getIndexedName() {
return indexedName;
}

public String getChildren() {
return children;
}

@Override
public boolean hasNext() {
return children != null;
}

@Override
public PropertyTokenizer next() {
return new PropertyTokenizer(children);
}

@Override
public void remove() {
throw new UnsupportedOperationException("Remove is not supported, as it has no meaning in the context of properties.");
}
}
30 changes: 30 additions & 0 deletions docs/spring/cs50712a8a-9aea-11ee-947e-acde48001122.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.huifer.bilibili.redis.entity.bo;

import com.huifer.bilibili.redis.entity.BookEntity;
import com.huifer.bilibili.redis.entity.UserEntity;

import java.util.List;

/**
* 假设存在这么一个对象
*/
public class UserInfo {
private UserEntity userEntity;
private List<BookEntity> bookEntity;

public UserEntity getUserEntity() {
return userEntity;
}

public void setUserEntity(UserEntity userEntity) {
this.userEntity = userEntity;
}

public List<BookEntity> getBookEntity() {
return bookEntity;
}

public void setBookEntity(List<BookEntity> bookEntity) {
this.bookEntity = bookEntity;
}
}
Loading

0 comments on commit fc12a76

Please sign in to comment.